Debian Codegraph @

checker/tests/nullness/java8/Issue1098.java

raw
1 // Test case for Issue 1098:
2 // https://github.com/typetools/checker-framework/issues/1098
3
4 import java.util.Optional;
5
6 class Issue1098 {
7 <T> void opt(Optional<T> p1, T p2) {}
8
9 <T> void cls(Class<T> p1, T p2) {}
10
11 void use() {
12 opt(Optional.empty(), null);
13 // TODO: false positive, because type agrument inference does not account for @Covariant.
14 // See https://github.com/typetools/checker-framework/issues/979.
15 // :: error: (argument.type.incompatible)
16 cls(this.getClass(), null);
17 }
18 }