If the return type can be inferred without declaring it, the declaration wouldn’t do anything. If the return type is different or not inferrable, the declaration adds a convert
step before returning, which would fail if not implemented. It does nothing about type instability in the function before the return statement.
4 Likes