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
In this example
@SuppressWarnings("nullity") class Test { abstract static class Typed<T> { abstract T get(); } <T> Optional<T> method1(Typed<? extends @Nullable T> arg) { return Optional.ofNullable(arg.get()); } <T> Optional<T> method2(Typed<? extends @Nullable T> arg) { return method1(arg); } }
compilation fails with error in method2
C:\Projects\pvyscomponents\java\libs\kernel\repository\api\src\main\java\com\provys\repository\Test.java:23:19 java: [return] incompatible types in return. type of expression: @Initialized @NonNull Optional<T extends @Initialized @NonNull Object> method return type: @Initialized @NonNull Optional<T extends @Initialized @Nullable Object>
I believe it should compile without warning, as if it used T as type argument in call to method1, all should be fine
The text was updated successfully, but these errors were encountered:
smillst
No branches or pull requests
In this example
compilation fails with error in method2
I believe it should compile without warning, as if it used T as type argument in call to method1, all should be fine
The text was updated successfully, but these errors were encountered: