-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Elixir and Erlang/OTP versions
Erlang/OTP 27 [erts-15.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Elixir 1.17.1 (compiled with Erlang/OTP 27)
Operating system
linux
Current behavior
defmodule Xxx do
defmacro f(x) do
quote generated: true do
unquote(x) < 2
end
end
def g do
f(:x)
end
end
Compiling 1 file (.ex)
warning: comparison between incompatible types found:
:x < 2
While Elixir can compare across all types, you are comparing across types which are always distinct, and the result is either always true or always false
typing violation found at:
│
9 │ f(:x)
│ ~~~~~
│
└─ lib/xxx.ex:9: Xxx.g/0
Expected behavior
No warning produced
Metadata
Metadata
Assignees
Labels
No labels