Open slepher opened 3 years ago
Describe the bug erl_syntax:set_pos/2 or erl_syntax:revert/1 is not works as expected
Node = {atom, 20, a}. Node1 = erl_syntax:revert(erl_syntax:set_pos(Node, 10)). ?assertEqual({atom, 10, a}, Node).
assertEqual above fails.
Reason erl_syntax use a wrapper to wrap erl_parse tree and erl_syntax:set_pos/2 only changes #wrapper.attr in wrapper record while use erl_syntax:revert/1 #wrapper.attr is dropped, original pos in erl_parse tree is not changed
Affected versions OTP 23 and higher
I believe that this is solved by https://github.com/erlang/otp/pull/7398
In OTP27, the assertion above succeeds.
Describe the bug erl_syntax:set_pos/2 or erl_syntax:revert/1 is not works as expected
assertEqual above fails.
Reason erl_syntax use a wrapper to wrap erl_parse tree and erl_syntax:set_pos/2 only changes #wrapper.attr in wrapper record while use erl_syntax:revert/1 #wrapper.attr is dropped, original pos in erl_parse tree is not changed
Affected versions OTP 23 and higher