Skip to content

Commit 9628bf8

Browse files
committed
Show non-expanded struct assocs in struct update deprecation warning
1 parent 40164fc commit 9628bf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/elixir/src/elixir_map.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ expand_map(Meta, Args, S, E) ->
1414
validate_kv(Meta, EArgs, Args, E),
1515
{{'%{}', Meta, EArgs}, SE, EE}.
1616

17-
expand_struct(Meta, Left, {'%{}', MapMeta, MapArgs}, S, #{context := Context} = E) ->
17+
expand_struct(Meta, Left, {'%{}', MapMeta, MapArgs} = Right, S, #{context := Context} = E) ->
1818
CleanMapArgs = delete_struct_key(Meta, MapArgs, E),
1919
{[ELeft, ERight], SE, EE} = elixir_expand:expand_args([Left, {'%{}', MapMeta, CleanMapArgs}], S, E),
2020

@@ -25,7 +25,7 @@ expand_struct(Meta, Left, {'%{}', MapMeta, MapArgs}, S, #{context := Context} =
2525
%% The update syntax for structs is deprecated,
2626
%% so we return only the update syntax downstream.
2727
%% TODO: Remove me on Elixir v2.0
28-
file_warn(MapMeta, ?key(E, file), ?MODULE, {deprecated_update, ELeft, ERight}),
28+
file_warn(MapMeta, ?key(E, file), ?MODULE, {deprecated_update, ELeft, Right}),
2929
_ = load_struct_info(Meta, ELeft, Assocs, EE),
3030
{{'%', Meta, [ELeft, ERight]}, SE, EE};
3131

0 commit comments

Comments
 (0)