checker/tests/nullness/generics/Issue240.java
raw| 1 | // Test case for Issue 240: |
| 2 | // https://github.com/typetools/checker-framework/issues/240 |
| 3 | |
| 4 | import org.checkerframework.checker.nullness.qual.Nullable; |
| 5 | |
| 6 | class I<A> {} |
| 7 | |
| 8 | // This should compile, because the implicit upper |
| 9 | // bound of I is "@Nullable Object" |
| 10 | class Use extends I<@Nullable String> {} |
| 11 | |
| 12 | class I2<A extends Object> {} |
| 13 | |
| 14 | // This use must be an error. |
| 15 | // :: error: (type.argument.type.incompatible) |
| 16 | class Use2 extends I2<@Nullable String> {} |