You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSpecify mode: a type argument is not checked against the type arguments inside its bound #2228
Found during differential testing, which uses the Lean framework and Specimen to generate well-typed programs and compares the verified Lean checker with NullAway.
A type argument is checked only against whether its bound is @Nullable, not against the type arguments inside the bound.
Test.java:18: error: [NullAway] incompatible types: Box<String> cannot be converted to Box<@Nullable String>
It should report an error on new Cleaner<Box<String>>(), because Box<String> is not within the bound Box<@Nullable String>. The program throws a NullPointerException at run time.
The same happens for a field, parameter, superclass, bound or explicit method type argument, and for the opposite mistake, Reader<Box<@Nullable String>> with B extends Box<String>. An inferred call such as clearStatic(box) for <B extends Box<@Nullable String>> void clearStatic(B box) is not reported either. The open pull requests #2086, #2098 and #2099 may cover that case, but not written type arguments.
NullAway 0.14.4 and master 1bf8910, Error Prone 2.53.0, JDK 26.0.1.
Activity