[erlang-bugs] Internal error in v3_core when using fun as map value

Ulf Norell ulf.norell@REDACTED
Tue Mar 4 09:22:56 CET 2014


-module(bug).
f() -> #{a => fun() -> ok end}#{a := false}.

I get a very similar error for this program:

-module(also_bug).
f() -> fun() -> 0 end#{}.

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

Eshell V6.0  (abort with ^G)
1> c(bug).
bug.erl: internal error in core_module;
crash reason: function_clause

  in function  v3_core:expr/2
     called as
v3_core:expr({'fun',2,{clauses,[{clause,2,[],[],[{atom,2,ok}]}]}},
 {core,0,0,false,true,[report_errors,report_warnings],[],[{file,"bug.erl"}]})
  in call from v3_core:safe/2 (v3_core.erl, line 1407)
  in call from v3_core:'-map_pair_list/2-anonymous-0-'/2 (v3_core.erl, line
720)
  in call from v3_core:expr/2 (v3_core.erl, line 499)
  in call from v3_core:safe/2 (v3_core.erl, line 1407)
  in call from v3_core:expr/2 (v3_core.erl, line 503)
  in call from v3_core:exprs/2 (v3_core.erl, line 467)
  in call from v3_core:clause/2 (v3_core.erl, line 209)
bug.erl:2: Warning: function f/0 is unused
error

/ Ulf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140304/7f8f6559/attachment.htm>


More information about the erlang-bugs mailing list