-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Milestone
Description
Environment
- elixir 1.5.1
- OTP 20.0
- Operating system: OSX
Current behavior
Adding a guard clause inside of an else block of a with statement causes dialyzer to raise an warning
Example:
def with_else do
with :ok <- ok_or_error(),
:ok <- ok_or_other_error(),
:ok <- ok_or_tuple_error(),
:ok <- ok_or_tuple_list_error() do
:ok
else
:error ->
:error
:other_error ->
:other_error
{:error, msg} when is_list(msg) ->
:error
{:error, _msg} ->
:error
end
end
Will raise a warning Guard test is_list(msg@1::'err') can never succeed
Expected behavior
No warning is raised, this was the behavior on 1.4.x
I've added a failing test case here for this issue.
Notes
- This is related to Dialyzer warnings with 1.5 using with/else statements #6378, but was not solved by 288fb9e.
- I've added a failing test case here for this issue
renatomassaro, wuhkuh, xadhoom and kelvinst