NullAway
NullAway copied to clipboard
JSpecify: work around missing type annotations in cast expression types
E.g., for this:
Object o = ...;
var x = (A<@Nullable String>) o;
The type of (A<@Nullable String>) o provided by javac is A<String>, not A<@Nullable String>. We should work around this.
This issue is fixed in JDK 24-ea, but most likely we should still implement a workaround in NullAway.
From my testing, it looks like this is also fixed in the latest JDK 23 release candidate. FYI @cpovirk
This issue diagnosed the problem incorrectly; see #1266.