<div dir="ltr"><div>Hello,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 5, 2019 at 9:39 AM <a href="mailto:block.rxckin.beats@gmail.com">block.rxckin.beats@gmail.com</a> <<a href="mailto:block.rxckin.beats@gmail.com">block.rxckin.beats@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I found strange behavior, see code below.<div><br></div><div>why last match doesn't works ?</div></div></blockquote><div><br></div><div>It is a bug in the compiler in OTP-22 that has been fixed. If you upgrade to the latest OTP-22 patched version it works as it should.</div><div><br></div><div>Lukas</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div><br></div><div>```main.erl</div><div>#!/usr/bin/env escript<br>-module(main).<br><br>-mode(compile).<br>-compile(export_all).<br><br>xy() -><br>    #{ 160506610  => x, 3960650446 => y }.<br><br>x() -><br>    #{ 160506610  => x }.<br><br>y() -><br>    #{ 3960650446 => y }.<br><br>xy2() -><br>    #{ 888888888  => x, 9999999999 => y }.<br><br>main(_) -><br>    #{ 160506610  := x } = xy(), % ok<br>    #{ 3960650446 := y } = xy(), % ok<br><br>    #{ 160506610  := x } = x(), % ok<br>    #{ 3960650446 := y } = y(), % ok<br><br><br>    #{ 888888888  := x,<br>       9999999999 := y<br>     } = xy2(), % ok<br><br><br>    #{ 160506610  := x,<br>       3960650446 := y<br>     } = xy(), % no match of right hand side value, WHY ??<br><br>    ok.<br></div><div>```</div><div><br></div><div>Erlang: Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]<br></div><div>OS: Ubuntu 19.04 disco</div></div>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div>