You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the checker complains about methods 2, 3 and 4 (i.e. bar, baz and qux) but not about methods 1 and 5 (i.e. foo and quuz). Somehow wrapping the conditional operator in Optional.of(...) requires one to add type hints to both branches.
The text was updated successfully, but these errors were encountered:
mernst
changed the title
NullnessChecker false positive with nested conditional operator
Type argument inference in nested conditional operator
Dec 14, 2020
Consider the following dummy code:
Compiling this code using the
NullnessChecker
we get the following output:Note that the checker complains about methods 2, 3 and 4 (i.e.
bar
,baz
andqux
) but not about methods 1 and 5 (i.e.foo
andquuz
). Somehow wrapping the conditional operator inOptional.of(...)
requires one to add type hints to both branches.The text was updated successfully, but these errors were encountered: