-
Notifications
You must be signed in to change notification settings - Fork 347
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
False nullability errors in 3.42.0 #6389
Comments
While bisecting for a good checker version for Beam, confirmed that this (and many others) also occurs in checker 3.40.0 |
I don't know if it is the same, but most of the issues I see are consistent with the following hypothesis: Given an object I also saw some cases even if |
Kenn, your hypothesis is correct: the Nullness Checker reasons that it is conceivable that a method has a reference to a field and sets the field. Because its aim is an iron-clad guarantee, it issues a warning in this case. In many cases this is a false positive warning, as you point out. The manual gives ways to specify your program so that the Nullness Checker can reason about (lack of) re-assignment, in section "Side effects, determinism, purity, and type refinement". Maybe one of these can work for you. In general, the solution to a false positive is often writing a specification (that is, annotations) to provide more information to the checker.
This sounds like a bug. Could you please report it? But, a question first: is it possible that More generally, if you have specific cases, please let us know about them individually and we can help you reason through them. |
Got it. Yes I will see if I can find a good way to manage these particular errors. If I reproduce the tangentially mentioned case, I will file a new issue. |
Reproduce:
Output:
etc.
Expectation: these are not errors. This field
currentReader
was set to a non-nullable value with no intervening method calls.The text was updated successfully, but these errors were encountered: