[erlang-questions] Strange problems with modifying records with matched maps on 17.4

Max Lapshin <>
Tue Mar 24 12:38:16 CET 2015


Thanks

On Tue, Mar 24, 2015 at 2:25 PM, Sergej Jurečko <>
wrote:

> Yes this is likely the same bug that I reported in february:
> http://erlang.org/pipermail/erlang-bugs/2015-February/004768.html
>
>
> Sergej
>
> On Tue, Mar 24, 2015 at 12:21 PM, Max Lapshin <>
> wrote:
>
>> https://gist.github.com/maxlapshin/a95d8a27ce93221d883a
>>
>> when I match map in record:
>>
>> modify(#r1{map_data = #{count := Cnt} = M}=R1) ->
>>
>> I get badarg when modify record in the end of function.
>>
>> I've attached two files looking similar in the gist.
>>
>>
>>
>>
>> When I launch first, I get badarg with the line of function header:
>>
>> erl -s map_test1 main
>>
>> Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:4:4] [ds:4:4:10]
>> [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
>>
>> Created: {r1,#{count => 1},0}
>>
>> {"init terminating in
>> do_boot",{badarg,[{map_test1,modify,1,[{file,"map_test1.erl"},{line,11}]},{map_test1,main,0,[{file,"map_test1.erl"},{line,8}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
>>
>>
>> when I launch second, it works (but makes useless work).
>>
>>
>> Is it a known bug? Or maybe it is not a bug, but just my misunderstanding?
>>
>>
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150324/cad357a8/attachment.html>


More information about the erlang-questions mailing list