[erlang-bugs] Internal error in sys_core_dsetel when binding variables in map expressions

Ulf Norell ulf.norell@REDACTED
Mon Mar 24 08:53:51 CET 2014


I have a couple more map-related issues. Same error for both of these:

-module(bug).
f() ->
  a = b#{c => X = 0},
  #{c => X}.

-module(bug).
f() ->
  a = {X = 0}#{},
  #{a => X}.

$ erl
Erlang/OTP 17 [RELEASE CANDIDATE 2] [erts-6.0] [source-c2b4eab] [64-bit]
[smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.0  (abort with ^G)
1> c(bug).
Function: f/0
bug.erl: internal error in core_dsetel_module;
crash reason: {badmatch,error}

  in function  sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 98)
  in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 110)
  in call from lists:mapfoldl/3 (lists.erl, line 1352)
  in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 186)
  in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 142)
  in call from lists:mapfoldl/3 (lists.erl, line 1352)
  in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 186)
  in call from sys_core_dsetel:visit/2 (sys_core_dsetel.erl, line 124)
bug.erl:2: Warning: function f/0 is unused
bug.erl:3: Warning: map construction will fail because of a type mismatch
bug.erl:3: Warning: this clause cannot match because of different
types/sizes
error

/ Ulf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140324/8a7f59da/attachment.htm>


More information about the erlang-bugs mailing list