An there is one more detail:
|
translate_remote(maps, put, Meta, [Key, Value, Map], S) -> |
|
Ann = ?ann(Meta), |
|
|
|
case translate_args([Key, Value, Map], Ann, S) of |
|
{[TKey, TValue, {map, _, InnerMap, Pairs}], TS} -> |
|
{{map, Ann, InnerMap, Pairs ++ [{map_field_assoc, Ann, TKey, TValue}]}, TS}; |
|
|
|
{[TKey, TValue, {map, _, Pairs}], TS} -> |
|
{{map, Ann, Pairs ++ [{map_field_assoc, Ann, TKey, TValue}]}, TS}; |
|
|
|
{[TKey, TValue, TMap], TS} -> |
|
{{map, Ann, TMap, [{map_field_assoc, Ann, TKey, TValue}]}, TS} |
rewrites :maps.put(key, value, map) into map update Map#{Key => Value}, which evaluates Map first. This makes raw :maps.put/3 affected by the bug but by chance negates the bug for Map.put
Originally posted by @lukaszsamson in #15310
The best option is to not rewrite/inline "Map.put/3" and we rewrite Map.put/3 in the Erlang compiler instead. I will open up a separate issue!
Originally posted by @lukaszsamson in #15310
The best option is to not rewrite/inline "Map.put/3" and we rewrite Map.put/3 in the Erlang compiler instead. I will open up a separate issue!