Debian Codegraph @

checker/tests/nullness/java8/Issue1098NoJdk.java

raw
1 // Test case for Issue 1098:
2 // https://github.com/typetools/checker-framework/issues/1098
3
4 @SuppressWarnings({"nullness", "initialization.fields.uninitialized"})
5 class MyObject {
6 Class<?> getMyClass() {
7 return null;
8 }
9 }
10
11 class Issue1098NoJdk {
12 <T> void cls2(Class<T> p1, T p2) {}
13
14 void use2(MyObject ths) {
15 // TODO: false positive, because type agrument inference does not account for @Covariant.
16 // See https://github.com/typetools/checker-framework/issues/979.
17 // :: error: (argument.type.incompatible)
18 cls2(ths.getMyClass(), null);
19 }
20 }