Closed maennchen closed 8 months ago
Yes, a PR would definitely be welcome. Either maps:put
should work, alternative could be to try and redefine the macro as:
-define(range_anno(Tok1, Tok2), begin #{
location => map_get(location, ?anno(Tok1)),
end_location => map_get(end_location, ?anno(Tok2))
} end).
I wonder if this might be enough to "fool" the compiler into not emitting a warning
@michalmuskala Yes, the begin ... end
trick works. :+1:
https://github.com/erlef/oidcc/actions/runs/7978117370/job/21787920914?pr=337
https://github.com/WhatsApp/erlfmt/blob/732d4438a2c246b8bcadabce52aed545ab2ac14a/src/erlfmt_parse.yrl#L98
It seems like the following is no longer allowed:
expr()#{property => value}
The code therefore will have to use
maps:put/3
ormaps:merge/2
instead.I'd be happy to provide a PR for that change.