<div dir="ltr"><div>-module(bug).</div><div>f(#{a := 0}) when #{} == #{}; true -> ok.</div><div><br></div><div>Same error for this:</div><div><br></div><div>-module(also_bug).</div><div>f(#{a := 0}) when true; map_size(0) -> ok.</div>

<div><br></div><div>There seems to be a general problem with complex guards under map patterns. I</div><div>ended up disabling all guards after a match on a map in the program generator.</div><div><br></div><div>$ erl</div>

<div>Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-a74e66a] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]</div><div><br></div><div>Eshell V6.0  (abort with ^G)</div><div>1> c(bug).</div><div>

Function: f/1</div><div>bug.erl: internal error in beam_bool;</div><div>crash reason: {case_clause,{'EXIT',{{case_clause,{get_map_elements,{f,5}}},</div><div>                      [{beam_jump,is_label_used_in_2,2,</div>

<div>                                  [{file,"beam_jump.erl"},{line,446}]},</div><div>                       {lists,any,2,[{file,"lists.erl"},{line,1223}]},</div><div>                       {beam_jump,is_label_used_in_1,3,</div>

<div>                                  [{file,"beam_jump.erl"},{line,438}]},</div><div>                       {beam_bool,split_block,5,</div><div>                                  [{file,"beam_bool.erl"},{line,278}]},</div>

<div>                       {beam_bool,bopt,3,[{file,"beam_bool.erl"},{line,64}]},</div><div>                       {beam_bool,function,2,</div><div>                                  [{file,"beam_bool.erl"},{line,57}]},</div>

<div>                       {lists,mapfoldl,3,[{file,"lists.erl"},{line,1352}]},</div><div>                       {beam_bool,module,2,</div><div>                                  [{file,"beam_bool.erl"},{line,36}]}]}}}</div>

<div><br></div><div>  in function  compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line 493)</div><div>  in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 290)</div><div>  in call from compile:fold_comp/3 (compile.erl, line 308)</div>

<div>  in call from compile:internal_comp/4 (compile.erl, line 292)</div><div>  in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 153)</div><div>bug.erl:2: Warning: function f/1 is unused</div>

<div>error</div><div><br></div><div>/ Ulf</div><div><br></div></div>