Skip to content

Commit

Permalink
Use Module.__info__(:functions) to determine if function exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Sinclair committed Aug 28, 2024
1 parent 2e33b65 commit 56685f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/expression/callbacks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ defmodule Expression.Callbacks do

defp wrong_arity_but_function_exists?(module, function_name)
when is_atom(module) and is_atom(function_name) do
Enum.any?(0..20, fn arity -> Kernel.function_exported?(module, function_name, arity) end)
module.__info__(:functions)[function_name] != nil
end

defmacro __using__(_opts) do
Expand Down

0 comments on commit 56685f4

Please sign in to comment.