Why? I’d expect they’d be written in the BEAM “tuple with a leading atom” idiom. A complex example, from gen_statem:
action() =
postpone |
{postpone, Postpone :: postpone()} |
{next_event,
EventType :: event_type(),
EventContent :: event_content()} |
{change_callback_module, NewModule :: module()} |
{push_callback_module, NewModule :: module()} |
pop_callback_module |
enter_action()
Exhaustiveness checking is mostly a difference of interpretation; if Dialyzer sees code like this:
case some_function_that_returns_action() do
{:postpone, p_value} -> ...
:pop_callback_module -> ...
end
it will assume that some_function_that_returns_action can’t return the other variants of action and try to derive a contradiction. It will also complain about dead code if subsequent analysis proves some_function_that_returns_action never returns :pop_callback_module.






















