| 1 |
// Test case for Issue 887 |
| 2 |
// https://github.com/typetools/checker-framework/issues/887 |
| 3 |
// Additional test case in framework/tests/all-systems/Issue887.java |
| 4 |
|
| 5 |
import java.util.List; |
| 6 |
import org.checkerframework.checker.nullness.qual.*; |
| 7 |
|
| 8 |
public abstract class Issue887 { |
| 9 |
void test() { |
| 10 |
// TODO: false negative |
| 11 |
//// :: error: (argument.type.incompatible) :: error: (type.argument.type.incompatible) |
| 12 |
method(foo(null).get(0)); |
| 13 |
methodNullable(fooNullable(null).get(0)); |
| 14 |
} |
| 15 |
|
| 16 |
void method(Number o) {} |
| 17 |
|
| 18 |
void methodNullable(@Nullable Number o) {} |
| 19 |
|
| 20 |
abstract <T extends Number> List<? extends T> foo(T t); |
| 21 |
|
| 22 |
abstract <T extends @Nullable Number> List<? extends T> fooNullable(T t); |
| 23 |
} |