Open theosotr opened 2 months ago
Thanks for reporting!
The bug seems to be with the special handling of the null literal in the type argument inference algorithm:
import org.checkerframework.checker.nullness.qual.Nullable;
class Issue6815<T> {
static <T extends Comparable<? super T>> Issue6815<T> m(T k) {
k.toString();
return new Issue6815<T>();
}
void method1(@Nullable Integer i) {
Issue6815.m(i); // true positive
}
void method2() {
Issue6815.m(null); // false negative
}
}
Command
File
Actual behavior
The code passes the checks but there's a NPE at runtime
Expected behavior
The code should have been rejected.