Existing issue
Elixir and Erlang/OTP versions
Erlang/OTP 28 [erts-16.4.0.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Interactive Elixir (1.21.0-dev)
Operating system
any
Current behavior
I understand that type widening and tail absorption is deliberate but it leads to surprising results. Here I construct a type [none(), (...), | term()] which is not inhabited by any value. none() gets overapproximated to term()
Repro:
t = non_empty_list(none(), term())
empty?(t) # false, I'd expect true
to_quoted_string(t) # "non_empty_list(term(), term())"
equal?(non_empty_list(none(), term()), non_empty_list(term(), term())) # true
Expected behavior
I don't know. Either accepted overapproximation or improved precision
Existing issue
Elixir and Erlang/OTP versions
Erlang/OTP 28 [erts-16.4.0.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Interactive Elixir (1.21.0-dev)
Operating system
any
Current behavior
I understand that type widening and tail absorption is deliberate but it leads to surprising results. Here I construct a type
[none(), (...), | term()]which is not inhabited by any value.none()gets overapproximated toterm()Repro:
Expected behavior
I don't know. Either accepted overapproximation or improved precision