Dialyzer cannot recognize error in function using polymorphic types

There’s likely special behaviour around empty lists in Erlang is my best guess. And dialyzer is widely admitted to not be the best at the job even by Erlang maintainers.

If I were you I’d try going all the way on nested tuples and have an Option type with {:option, {:some, value}} and {:option, :none} and see if Dialyzer chokes on those. I’d guess it wouldn’t.

2 Likes