jeremyjh / dialyxir

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

Warning not filtered by regex #443

Open dantswain opened 2 years ago

dantswain commented 2 years ago

Precheck

Environment

Current behavior

I'm getting a warning that doesn't make sense (an else clause from a with construct, but that's a separate issue) that I'd like to ignore. I have tried adding a regex to my dialyzer ignore file and I'm seeing weird behavior wrt that regex actually filtering the warning.

Here is the warning (somewhat redacted):

# --format dialyzer
lib/foo_server.ex:49: The pattern {'error', 'not_found'} can never match the type {'error','some_error1' | 'some_error2'}
# --format raw
{:warn_matching, {'lib/foo_server.ex', 49}, {:pattern_match, ['pattern {\'error\', \'not_found\'}', '{\'error\',\'some_error1\' | \'some_error2\'}']}}

It seems whenever I include any subset of not_found in the regex, it does not work ("work" == "ignores the warning"). Here are some regexes that do/do not work:

Expected behavior

I would have expected all of these regexes to work.