Compiling the code below in 1.5.0 will show the warning message “this clause cannot match because of different types/sizes”, but not in 1.4.5. Is this a regression or an expected change in the compiler behaviour?
fun = fn ->
:rand.seed(:exs64)
if(:rand.uniform > 0.5, do: :ok, else: {:error, :fail})
end
with {:step1, :ok} <- {:step1, fun.()},
{:step2, :ok} <- {:step2, fun.()} do
:ok
else
{:step1, {:error, reason}} -> {:error, reason}
{:step2, {:error, reason}} -> {:error, reason}
end
Edit:
~ ❯❯❯ elixirc with.ex
warning: this clause cannot match because of different types/sizes
with.ex:10
warning: this clause cannot match because of different types/sizes
with.ex:11