JSpecifyExperimental mode on.
@NullMarked
class Test {
public Collection<Object> foo(List<?> list) {
List<Object> result = new ArrayList<>();
// BUG: List<?> cannot be converted to Collection<? extends Object> (List<?> is a subtype of Collection<?>)
result.addAll(list);
return result;
}
}
Shows compilation error:
[ERROR]Test.java[6,22]: [NullAway] incompatible types: List<?> cannot be converted to Collection<? extends Object> (List<?> is a subtype of Collection<?>)
NullAway 0.14.1, Error Prone 2.50.0.
JSpecifyExperimental mode on.
Shows compilation error:
NullAway 0.14.1, Error Prone 2.50.0.