You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ $HOME/checker-framework-3.21.0/checker/bin/javac -processor nullness CaptureOuter.java
CaptureOuter.java:11: error: [return] incompatible types in return.
return o.get();
^
type of expression: capture#84 extends @Initialized @Nullable Object
method return type: @Initialized @NonNull Object
CaptureOuter.java:15: error: [return] incompatible types in return.
return o.get();
^
type of expression: @Initialized ? extends @Initialized @Nullable Object
method return type: @Initialized @NonNull Object
2 errors
The call to CaptureOuter.get() has a type of capture#84 extends @Initialized @Nullable Object, as expected.
But the call to CaptureOuter.Inner.get() has a type of @Initialized ? extends @Initialized @Nullable Object.
Contrast this to what javac does if the return types of the getFrom methods is changed to String: In both cases, it identifies the call as having a type of CAP#1.
The text was updated successfully, but these errors were encountered:
The call to CaptureOuter.get() has a type of
capture#84 extends @Initialized @Nullable Object
, as expected.But the call to CaptureOuter.Inner.get() has a type of
@Initialized ? extends @Initialized @Nullable Object
.Contrast this to what javac does if the return types of the getFrom methods is changed to String: In both cases, it identifies the call as having a type of
CAP#1
.The text was updated successfully, but these errors were encountered: