We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following use case
public class Test { @Nullable Object item; <T> @Nullable T getNullable(Class<T> type) { return type.cast(item); } <T> Optional<T> getOpt(int index, Class<? extends T> type) { return Optional.ofNullable(getNullable(type)); } }
fails compilation in getOpt method with
java: [argument] incompatible argument for parameter type of Test.getNullable. found : @Initialized @NonNull Class<capture#01 extends T extends @Initialized @Nullable Object> required: @Initialized @NonNull Class<T extends @Initialized @NonNull Object>
I believe it should compile fine, as neither method makes any assumption about nullity constraints on type variable
It compiled fine with 3.42.0, fails with 3.46.0
The text was updated successfully, but these errors were encountered:
smillst
No branches or pull requests
Following use case
fails compilation in getOpt method with
I believe it should compile fine, as neither method makes any assumption about nullity constraints on type variable
It compiled fine with 3.42.0, fails with 3.46.0
The text was updated successfully, but these errors were encountered: