Skip to content

Commit

Permalink
Remove changes from v2 as it's obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Sinclair committed Aug 28, 2024
1 parent 74ae0ab commit 2e33b65
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions lib/expression/v2/callbacks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,12 @@ defmodule Expression.V2.Callbacks do
function_exported?(Standard, vargs_function_name, 2) ->
{:vargs, Standard, vargs_function_name}

# Check if the wrong number of arguments was provided
wrong_arity_but_function_exists?(module, exact_function_name) ->
{:error, "wrong number of arguments to #{function_name}."}

# Check if the wrong number of arguments was provided
wrong_arity_but_function_exists?(Standard, exact_function_name) ->
{:error, "wrong number of arguments to #{function_name}."}

# Otherwise fail
true ->
{:error, "#{function_name} is not implemented."}
end
end

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)
end

defmacro __using__(_opts) do
quote do
def callback(module \\ __MODULE__, context, function_name, args)
Expand Down

0 comments on commit 2e33b65

Please sign in to comment.