-
Notifications
You must be signed in to change notification settings - Fork 437
Capture conversion forgets annotation #3754
Copy link
Copy link
Closed
Description
For this code:
import org.checkerframework.checker.nullness.qual.Nullable;
class Issue3754 {
interface Supplier<T extends @Nullable Object, U extends T> {
U get();
}
Object x(Supplier<? extends Object, ?> bar) {
return bar.get();
}
}the Nullness Checker issues this warning:
Issue3754.java:9: error: [return.type.incompatible] incompatible types in return.
return bar.get();
^
type of expression: ? extends capture#519 of ? extends java.lang.Object extends @Initialized @Nullable Object
method return type: @Initialized @NonNull Object
I think the code should type-check.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels