-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
Description
Environment
- Elixir & Erlang/OTP versions (elixir --version):
Erlang/OTP 24 [erts-12.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Elixir 1.14.0-dev (bdcf887) (compiled with Erlang/OTP 23)
Happens on Elixir 1.12.3 and 1.13.3 as well
- Operating system: Mac OS 11.6
Current behavior
Compiling this:
defmodule A do
def fun(state, key) do
key0 = key
state = %{state | key0 => true}
key1 = key
state = %{state | key1 => true}
state
end
endgives this warning:
warning: incompatible types:
map() !~ var2
in expression:
# a.exs:6
state = %{state | key1 => true}
where "state" was given the type map() in:
# a.exs:6
state = %{state | key1 => true}
Conflict found at
a.exs:6: A.fun/2
Expected behavior
No warning should be reported