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

Upstreaming: Promote cast.unsafe from a warning to an error #8

Open
cpovirk opened this issue Nov 9, 2020 · 2 comments
Open

Upstreaming: Promote cast.unsafe from a warning to an error #8

cpovirk opened this issue Nov 9, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@cpovirk
Copy link
Collaborator

cpovirk commented Nov 9, 2020

9ab109c

I assume that we don't really need to upstream this: The built-in CF nullness checker reports a full error for cases like casting from @Nullable Object to int. It might well always do this in cases that are actually unsafe (although then... why issue a warning?). (The built-in CF nullness checker also doesn't report an error, so perhaps it takes some action to short-circuit the cast.unsafe check.) Presumably we could do the same. But for now, I made cast.unsafe an error in our copy.

@cpovirk
Copy link
Collaborator Author

cpovirk commented Jan 26, 2021

See also jspecify/jspecify-reference-checker@559ba69, in which we undo some of the errors created by this change... :)

@cpovirk
Copy link
Collaborator Author

cpovirk commented Jun 1, 2021

If for some reason we need this in the long term, we could probably avoid carrying a patch against CF by overriding SourceChecker.reportWarning to behave like reportError.

@wmdietl wmdietl added the enhancement New feature or request label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants