jeremyjh / dialyxir

Mix tasks to simplify use of Dialyzer in Elixir projects.
Apache License 2.0
1.69k stars 141 forks source link

Failed to format warning #412

Open garthk opened 4 years ago

garthk commented 4 years ago

Precheck

Environment

Current behavior

Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.

Failed to format warning:
"@spec a({_module, _, _, _}, <<_m@1/binary>>) :: :ok\ndef a() do\n  :ok\nend\n"

Legacy warning:
lib/braun_support/tracing/tracing.ex:414: The pattern <{_module@1, _, _, _}, <<_m@1/binary>>> can never match the type <_,atom()>
________________________________________________________________________________
lib/braun_support/tracing/tracing.ex:415:pattern_match
The pattern can never match the type.

Pattern:
{_module, _, _, _}, _r = %Regex{}

Type:
_, atom()

Expected behavior

Not “Please file a bug”.

garthk commented 4 years ago

mix dialyzer --format raw output:

{:warn_matching, {'lib/braun_support/tracing/tracing.ex', 414}, {:pattern_match, ['pattern <{_module@1, _, _, _}, <<_m@1/binary>>>', '<_,atom()>']}}
{:warn_matching, {'lib/braun_support/tracing/tracing.ex', 415}, {:pattern_match, ['pattern <{_module@1, _, _, _}, _r@1 = \#{\'__struct__\':=\'Elixir.Regex\'}>', '<_,atom()>']}}