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

Anthony Ramine n.oxyde@REDACTED
Sat Mar 1 16:14:48 CET 2014


Am fixing this.

Map arguments aren’t properly expanded in the sys_pre_expand module.

-- 
Anthony Ramine

Le 1 mars 2014 à 10:47, José Valim <jose.valim@REDACTED> a écrit :

> 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
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs




More information about the erlang-bugs mailing list