| 1 |
import java.util.List; |
| 2 |
import org.checkerframework.checker.nullness.qual.*; |
| 3 |
|
| 4 |
class WildcardAnnos { |
| 5 |
// :: error: (bound.type.incompatible) |
| 6 |
@Nullable List<@Nullable ? extends @NonNull Object> l1 = null; |
| 7 |
@Nullable List<@NonNull ? extends @Nullable Object> l2 = null; |
| 8 |
|
| 9 |
// The implicit upper bound is Nullable, because the annotation |
| 10 |
// on the wildcard is propagated. Therefore this type is: |
| 11 |
// @Nullable List<? super @NonNull Object extends @Nullable Object> l3 = null; |
| 12 |
@Nullable List<@Nullable ? super @NonNull Object> l3 = null; |
| 13 |
|
| 14 |
// :: error: (bound.type.incompatible) |
| 15 |
@Nullable List<@NonNull ? super @Nullable Object> l4 = null; |
| 16 |
|
| 17 |
@Nullable List<? super @Nullable Object> l5 = null; |
| 18 |
|
| 19 |
@Nullable List<? extends @Nullable Object> inReturn() { |
| 20 |
return null; |
| 21 |
} |
| 22 |
|
| 23 |
void asParam(List<? extends @Nullable Object> p) {} |
| 24 |
|
| 25 |
// :: error: (type.invalid.conflicting.annos) |
| 26 |
@Nullable List<@Nullable @NonNull ? extends @Nullable Object> l6 = null; |
| 27 |
// :: error: (type.invalid.conflicting.annos) |
| 28 |
@Nullable List<@Nullable @NonNull ? super @NonNull Object> l7 = null; |
| 29 |
// :: error: (type.invalid.conflicting.annos) |
| 30 |
@Nullable List<? extends @Nullable @NonNull Object> l8 = null; |
| 31 |
// :: error: (type.invalid.conflicting.annos) |
| 32 |
@Nullable List<? super @Nullable @NonNull Object> l9 = null; |
| 33 |
} |