Skip to content

Commit 231d65e

Browse files
author
Yuki Ito
committed
Fix checking unused local functions and default arguments
1 parent 91e8e21 commit 231d65e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/elixir/src/elixir_def_local.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ check_unused_local(Fun, Kind, Line, File, 0, Recorded) ->
8181
not(lists:member(Fun, Recorded)) andalso
8282
elixir_errors:handle_file_warning(File, { Line, ?MODULE, { unused_def, Kind, Fun } });
8383

84-
check_unused_local({ _, Arity } = Fun, Kind, Line, File, Defaults, Recorded) when Defaults > 0 ->
84+
check_unused_local({ Name, Arity } = Fun, Kind, Line, File, Defaults, Recorded) when Defaults > 0 ->
8585
Min = Arity - Defaults,
8686
Max = Arity,
8787

88-
Invoked = [A || { _, A } <- Recorded, A >= Min, A =< Max],
88+
Invoked = [A || { N, A } <- Recorded, A >= Min, A =< Max, N == Name],
8989

9090
case Invoked of
9191
[] ->

0 commit comments

Comments
 (0)