| 1 |
import org.checkerframework.checker.nullness.qual.*; |
| 2 |
import org.checkerframework.framework.qual.DefaultQualifier; |
| 3 |
import org.checkerframework.framework.qual.TypeUseLocation; |
| 4 |
|
| 5 |
class MyGenClass<T extends @Nullable Object> {} |
| 6 |
|
| 7 |
@DefaultQualifier(value = Nullable.class, locations = TypeUseLocation.UPPER_BOUND) |
| 8 |
class Varargs { |
| 9 |
void test() { |
| 10 |
ignore(newInstance()); |
| 11 |
} |
| 12 |
|
| 13 |
static void ignore(MyGenClass<?>... consumer) {} |
| 14 |
|
| 15 |
static <T> MyGenClass<T> newInstance() { |
| 16 |
return new MyGenClass<T>(); |
| 17 |
} |
| 18 |
} |