Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir): 1.2.0
Current behavior
Describe current behavior. Include errors, stack traces, and any additional information that might be important here.
dializer succeeds in Foo.test_1/0 But Foo.test_2/0 failed
defmodule Foo do
def test_1() do
with {:ok, _} <- aa(),
{:ok, _} <- bb(),
{:ok, _} <- cc() do
:success
else
nil -> :error_c
{:error, _} -> :error_a
{:error, _, _} -> :error_b
end
end
def test_2() do
with {:ok, _} <- aa(),
{:ok, _} <- bb(),
{:ok, _} <- cc() do
:success
else
nil ->
:error_c
err ->
case err do
{:error, _} -> :error_a
{:error, _, _} -> :error_b
end
end
end
defp aa() do
if Enum.random(0..1) == 1 do
{:ok, 1}
else
{:error, 2}
end
end
defp bb() do
if Enum.random(0..1) == 1 do
{:ok, 3}
else
{:error, 4, 5}
end
end
defp cc() do
if Enum.random(0..1) == 1 do
{:ok, 6}
else
nil
end
end
end
Expected behavior
A short description of the expected behavior.
Everyone needs to succeed.
all functions(test_1, test_2) work successfully.
Precheck
Environment
Elixir & Erlang/OTP versions (elixir --version): 1.13.4
Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir): 1.2.0
Current behavior
dializer succeeds in
Foo.test_1/0
ButFoo.test_2/0
failedExpected behavior
Everyone needs to succeed. all functions(
test_1
,test_2
) work successfully.