Skip to content

Commit c80ffa2

Browse files
committed
PR review fixes
1 parent 1be2d9d commit c80ffa2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/elixir/lib/macro/env.ex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ defmodule Macro.Env do
9696
]
9797

9898
@type expand_import_opts :: [
99-
allow_locals: boolean() | (Macro.metadata(), atom(), arity(), [atom()], t() -> any()),
99+
allow_locals:
100+
boolean() | (Macro.metadata(), atom(), arity(), t() -> function() | false),
100101
check_deprecations: boolean(),
101102
trace: boolean()
102103
]
@@ -563,9 +564,7 @@ defmodule Macro.Env do
563564
- When `true`, uses a default resolver that looks for public macros in
564565
the current module
565566
- When a function, uses the function as a custom local resolver. The function
566-
must have the signature: `(meta, name, arity, kinds, env) -> function() | false`
567-
where `kinds` is a list of atoms indicating the types of symbols being
568-
searched (e.g., `[:defmacro, :defmacrop]`)
567+
must have the signature: `(meta, name, arity, env) -> function() | false`
569568
570569
* `:check_deprecations` - when set to `false`, does not check for deprecations
571570
when expanding macros
@@ -592,7 +591,7 @@ defmodule Macro.Env do
592591
# When allow_locals is a callback, we don't need to pass module macros as extra
593592
# because the callback will handle local macro resolution
594593
extra =
595-
if is_function(allow_locals, 5) do
594+
if is_function(allow_locals, 4) do
596595
[]
597596
else
598597
case allow_locals and function_exported?(module, :__info__, 1) do

lib/elixir/src/elixir_dispatch.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ expand_import(Meta, Name, Arity, E, Extra, AllowLocals, Trace) ->
175175
Local = case AllowLocals of
176176
false -> false;
177177
true -> elixir_def:local_for(Meta, Name, Arity, [defmacro, defmacrop], E);
178-
Fun when is_function(Fun, 5) ->
178+
Fun when is_function(Fun, 4) ->
179179
%% If we have a custom local resolver, use it.
180-
Fun(Meta, Name, Arity, [defmacro, defmacrop], E)
180+
Fun(Meta, Name, Arity, E)
181181
end,
182182

183183
case Dispatch of

0 commit comments

Comments
 (0)