Skip to content

Commit f07bb17

Browse files
committed
Fix function overriding
1 parent 7c60586 commit f07bb17

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/boss_record_compiler.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ list_functions([], DefinedFunctions) ->
9696
lists:reverse(DefinedFunctions);
9797
list_functions([{'function', _, Name, Arity, _}|Rest], DefinedFunctions) ->
9898
list_functions(Rest, [{Name, Arity}|DefinedFunctions]);
99-
list_functions([{tree, 'function', _, {Function, {tree, 'atom', _, Name},
99+
list_functions([{tree, 'function', _, {FunctionTag, {tree, 'atom', _, Name},
100100
[{tree, 'clause', _, {'clause', Args, _, _}}|_]}}|Rest],
101-
DefinedFunctions) when Function =:= 'function'; Function =:= 'func' ->
101+
DefinedFunctions) when FunctionTag =:= 'function'; FunctionTag =:= 'func' ->
102102
Arity = length(Args),
103103
list_functions(Rest, [{Name, Arity}|DefinedFunctions]);
104104
list_functions([_H|T], DefinedFunctions) ->
@@ -112,10 +112,10 @@ override_functions([{'function', _, Name, Arity, _} = Function|Rest], Acc, Defin
112112
true -> override_functions(Rest, Acc, DefinedFunctions);
113113
false -> override_functions(Rest, [Function|Acc], [{Name, Arity}|DefinedFunctions])
114114
end;
115-
override_functions([{tree, 'function', _, {Function, {tree, 'atom', _, Name},
115+
override_functions([{tree, 'function', _, {FunctionTag, {tree, 'atom', _, Name},
116116
[{tree, 'clause', _, {'clause', Args, _, _}}|_]
117117
}} = Function|Rest],
118-
Acc, DefinedFunctions) when Function =:= 'function'; Function =:= 'func' ->
118+
Acc, DefinedFunctions) when FunctionTag =:= 'function'; FunctionTag =:= 'func' ->
119119
Arity = length(Args),
120120
case lists:member({Name, Arity}, DefinedFunctions) of
121121
true -> override_functions(Rest, Acc, DefinedFunctions);

0 commit comments

Comments
 (0)