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
Describe the bug
When using a guard such as when X =:= nil or when X =:= nil orelse orelse X =:= false, dialyzer is not able to eliminate the nil type from the integer() | nil return type and incorrectly complains about a missingnil type when turning on the -Wmissing_return flag.
Thanks for your report! We do not consider this a bug, when you ask dialyzer to go beyond its capabilities (e.g. by specifying -Wmissing_return or similar options), it may report things that cannot happen for reasons it's unable to infer.
You're essentially changing its mode from "only report things you know for certain" to "report things you think might be wrong," and warnings like these naturally arise from the latter.
That said, we may be able to fix this particular case. We'll look into it. :)
Describe the bug
When using a guard such as
when X =:= nil
orwhen X =:= nil orelse orelse X =:= false
, dialyzer is not able to eliminate thenil
type from theinteger() | nil
return type and incorrectly complains about a missingnil
type when turning on the-Wmissing_return
flag.To Reproduce
fails with
Expected behavior
No error being raised.
Affected versions
26.2.1
Additional context
This bug is affecting truthiness checks in Elixir such as
one(text) || two(text)
(see elixir-lang/elixir#13269).The text was updated successfully, but these errors were encountered: