[erlang-patches] bug fix patch for revert map_field_assoc in syntax_tools

Roland Karlsson <>
Mon Apr 21 15:03:30 CEST 2014

In tag OTP-17.0 there is a bug in syntax_tools


2> erl_syntax:revert_forms( [{tree,map_field_assoc,{attr,16,[],none},{map_field_assoc,{atom,17,key},{var,18,'Value'}}}]).

As you can see, the key field is duplicated, replacing the value field.

I have made a patch fixing this bug. It can be extracted with

git clone https://github.com/rolkar/otp.git

The fix is found in the branch fixing-revert-bug


The patch contains two commits. The first adds a test case that fails.
The second fixes the problem in the code.

Roland Karlsson <>

More information about the erlang-patches mailing list