Skip to content

Commit fb82b0c

Browse files
author
José Valim
committed
Pick latest variable in between clauses instead of picking a random one
1 parent 9dc7f44 commit fb82b0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/src/elixir_clauses.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ do_match(Meta, DecoupledClauses, S) ->
113113
% Now get all the variables defined inside each clause
114114
CV = lists:reverse(ReverseCV),
115115
AllVars = lists:foldl(fun(KV, Acc) ->
116-
orddict:merge(fun(_, _, V) -> V end, KV, Acc)
116+
elixir_scope:merge_clause_vars(Acc, KV)
117117
end, orddict:new(), CV),
118118

119119
% Create a new scope that contains a list of all variables

0 commit comments

Comments
 (0)