Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSpecify: work around missing type annotations in cast expression types #1022

Open
msridhar opened this issue Aug 19, 2024 · 2 comments
Open
Labels
jspecify Related to support for jspecify standard (see jspecify.dev)

Comments

@msridhar
Copy link
Collaborator

msridhar commented Aug 19, 2024

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 msridhar added the jspecify Related to support for jspecify standard (see jspecify.dev) label Aug 19, 2024
@msridhar msridhar changed the title JSpecify: work around missing type annotations in (some?) var-declared variables JSpecify: work around missing type annotations in cast expressions Aug 19, 2024
@msridhar msridhar changed the title JSpecify: work around missing type annotations in cast expressions JSpecify: work around missing type annotations in cast expression types Aug 19, 2024
@msridhar
Copy link
Collaborator Author

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

@msridhar
Copy link
Collaborator Author

msridhar commented Sep 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jspecify Related to support for jspecify standard (see jspecify.dev)
Projects
None yet
Development

No branches or pull requests

1 participant