[erlang-bugs] Internal error in sys_core_fold when using repeated keys in map pattern

Anthony Ramine n.oxyde@REDACTED
Wed Mar 5 00:20:21 CET 2014


Not related to dupe keys:

	f(X) -> [[#{a := _ = _}] = [X]].

This could theoretically happen with binary patterns, but these are disallowed to contain aliases; your own example shows that it would be weird to forbid them in maps.

-- 
Anthony Ramine

Le 4 mars 2014 à 14:20, Ulf Norell <ulf.norell@REDACTED> a écrit :

> -module(bug).
> f(X) -> [[#{a := _, a := _}] = [X]].
> 
> $ erl
> Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-2fbbc2f] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
> 
> Eshell V6.0  (abort with ^G)
> 1> c(bug).
> Function: f/1
> bug.erl: internal error in core_fold_module;
> crash reason: function_clause
> 
>   in function  sys_core_fold:expr/3
>      called as sys_core_fold:expr({c_alias,[],{c_var,[],cor4},{c_var,[],cor5}},
>  value,
>  {sub,[],{4,{cor0,{'X',nil,nil},{cor4,nil,{cor5,nil,nil}}}},[],false})
>   in call from sys_core_fold:pair/3 (sys_core_fold.erl, line 437)
>   in call from sys_core_fold:pair_list/3 (sys_core_fold.erl, line 431)
>   in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 250)
>   in call from sys_core_fold:expr/3 (sys_core_fold.erl, line 231)
>   in call from sys_core_fold:opt_simple_let/3 (sys_core_fold.erl, line 2549)
>   in call from sys_core_fold:clause/4 (sys_core_fold.erl, line 1481)
>   in call from sys_core_fold:clauses/5 (sys_core_fold.erl, line 1699)
> bug.erl:2: Warning: function f/1 is unused
> error
> 
> / Ulf
> 
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs




More information about the erlang-bugs mailing list