Skip to content

Commit 486cb79

Browse files
committed
Store @specs in the order they were specified in the source code
1 parent fe13173 commit 486cb79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/elixir/src/elixir_module.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ specs_form(Line, Module, Defmacro, DefmacropWithLine, Forms, C) ->
196196
end.
197197

198198
specs_attributes(Line, Type, Forms, Specs) ->
199-
Keys = lists:ukeysort(1, Specs),
199+
Keys = lists:foldl(fun({ Tuple, Value }, Acc) ->
200+
lists:keystore(Tuple, 1, Acc, { Tuple, Value } )
201+
end, [], Specs),
200202
lists:foldl(fun({ Tuple, _ }, Acc) ->
201203
Values = [V || { K, V } <- Specs, K == Tuple],
202204
[{ attribute, Line, Type, { Tuple, Values } }|Acc]

0 commit comments

Comments
 (0)