Replies: 1 comment 3 replies
-
This is to be expected. The nullability analysis relies on logical operators to deduce whether any given variable can be null. Bitwise operators are not logical, and are therefore invalid for nullability analysis. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have this code fragment here which works great:
However, if I change the logical-and operators to bitwise-and operators (
&&
to&
), then I get warnings for the expressions in theSettings
constructor ("X may be null here"). Which doesn't seem correct; when do logical and bitwise operators compute different results?My reasoning for wanting to do bitwise here is that these validate methods log why the setting is invalid. With bitwise-and it'll check all the settings and if there's two-or-more problems they'll all be logged. With logical-and it'll only log the first invalid setting.
Beta Was this translation helpful? Give feedback.
All reactions