[erlang-bugs] Map updates with binaries on the lhs do not compile

José Valim jose.valim@REDACTED
Sat Mar 1 10:47:32 CET 2014


The following example does not work:

-module(foo).
-compile(export_all).

bar() ->
  (some:code(<<"hello">>))#{name => <<"world">>}.


With the following error:

foo.erl: internal error in core_module;
crash reason: badarg

  in function  lists:member/2
     called as lists:member(big,default)
  in call from v3_core:verify_suitable_fields/1 (v3_core.erl, line 805)
  in call from v3_core:constant_bin_1/1 (v3_core.erl, line 788)
  in call from v3_core:constant_bin/1 (v3_core.erl, line 782)
  in call from v3_core:expr_bin/3 (v3_core.erl, line 766)
  in call from v3_core:expr/2 (v3_core.erl, line 508)
  in call from v3_core:safe/2 (v3_core.erl, line 1407)
  in call from v3_core:expr/2 (v3_core.erl, line 483)


I am assuming the binaries on the left hand side of the update operator are
not being normalized, that's why we are attempting lists:member(big,
default), where "default" was supposed to be replaced by the normalized
binary values.

Thank you!

*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Lead Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140301/22c9da77/attachment.htm>


More information about the erlang-bugs mailing list