NullAway icon indicating copy to clipboard operation
NullAway copied to clipboard

JSpecify: work around missing type annotations in cast expression types

Open msridhar opened this issue 1 year ago • 2 comments

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.

msridhar avatar Aug 19 '24 17:08 msridhar

This issue is fixed in JDK 24-ea, but most likely we should still implement a workaround in NullAway.

msridhar avatar Aug 22 '24 20:08 msridhar

From my testing, it looks like this is also fixed in the latest JDK 23 release candidate. FYI @cpovirk

msridhar avatar Sep 08 '24 00:09 msridhar

This issue diagnosed the problem incorrectly; see #1266.

msridhar avatar Aug 31 '25 18:08 msridhar