We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Erlang/OTP 25 [erts-13.1.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] Elixir 1.14.2 (compiled with Erlang/OTP 25)
macos
Compiling this snippet raises a type warning:
defmodule Foo do def bar(token, number) when is_number(number) do case token do token when is_float(number) -> token token when is_integer(number) -> token end end end
integer() !~ float()
in expression:
# test.exs:4 is_float(number)
where "number" was given the type integer() | float() in:
# test.exs:2 is_number(number)
where "number" was given the type float() in:
Conflict found at test.exs:4: Foo.bar/1
notably this code correctly doesn't warn, which is the expected behaviour for the block above as well
defmodule Foo do def bar(number) when is_number(number) do case number do number when is_float(number) -> :float number when is_integer(number) -> :integer end end end
The text was updated successfully, but these errors were encountered:
Moved to #10485.
Sorry, something went wrong.
No branches or pull requests
Elixir and Erlang/OTP versions
Erlang/OTP 25 [erts-13.1.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
Elixir 1.14.2 (compiled with Erlang/OTP 25)
Operating system
macos
Current behavior
Compiling this snippet raises a type warning:
warning: incompatible types integer() !~ float()
warning: incompatible types:in expression:
where "number" was given the type integer() | float() in:
where "number" was given the type float() in:
Conflict found at
test.exs:4: Foo.bar/1
Expected behavior
notably this code correctly doesn't warn, which is the expected behaviour for the block above as well
The text was updated successfully, but these errors were encountered: