[erlang-bugs] Dialyzer crashes on empty map case pattern that can never match

James Fish james@REDACTED
Mon Apr 28 00:00:24 CEST 2014


Dialyzer crashes when analysing a case clause with an empty map pattern
when it is known that the pattern can never match.

Minimal example:

function(Tuple) when is_tuple(Tuple) ->
    case Tuple of #{} -> ok end.

Result:

dialyzer: Analysis failed with error:
{{case_clause,#{}},
 [{cerl_prettypr,lay_literal,2,[{file,"cerl_prettypr.erl"},{line,468}]},
  {cerl_prettypr,lay_ann,2,[{file,"cerl_prettypr.erl"},{line,411}]},
  {cerl_prettypr,format,2,[{file,"cerl_prettypr.erl"},{line,271}]},
  {dialyzer_dataflow,format_patterns,1,
                     [{file,"dialyzer_dataflow.erl"},{line,3351}]},

{dialyzer_dataflow,do_clause,6,[{file,"dialyzer_dataflow.erl"},{line,1245}]},
  {dialyzer_dataflow,handle_clauses,9,
                     [{file,"dialyzer_dataflow.erl"},{line,1177}]},
  {dialyzer_dataflow,handle_case,3,
                     [{file,"dialyzer_dataflow.erl"},{line,936}]},
  {dialyzer_dataflow,do_clause,6,
                     [{file,"dialyzer_dataflow.erl"},{line,1372}]}]}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140427/03612cfb/attachment.htm>


More information about the erlang-bugs mailing list