jeremyjh / dialyxir

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

Unknown warning :record_match #445

Closed rlipscombe closed 8 months ago

rlipscombe commented 2 years ago

Environment

Current behavior

Unknown warning:
:record_match

Legacy warning:
src/my_module.erl:321:1: Matching of pattern <_Req = {'foo', _, _, _, _, 'undefined', _, _}, _State> tagged with a record name violates the declared type of <#bar{},#state{state::#pending{baz::binary(),quux::integer()},common::#common{peer::{_,_}}}>
jeremyjh commented 2 years ago

It looks like this is not a new warning in dialyzer, but might be one that is not possible to generate in Elixir code. I'm wondering what the best way to handle that would be? I'm tempted to say that we should always print the "legacy" warning when a warning is generated in a .erl file because reformatting all the Erlang terms as Elixir doesn't make any sense for those warnings.

rlipscombe commented 2 years ago

Honestly, we're building an entirely-Erlang project using mix (because reasons), so if the answer is just "use the legacy formatter", I could live with that.

If we were actually doing a mixed-language project, then your suggestion is the better one, I think.