Skip to content

Commit 9e80f3b

Browse files
author
José Valim
committed
Add guard to impl of Enumerable for Function
This improves the stacktrace in case of wrong dispatch.
1 parent 01bda97 commit 9e80f3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/lib/enum.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,7 @@ defimpl Enumerable, for: Map do
21952195
end
21962196

21972197
defimpl Enumerable, for: Function do
2198-
def reduce(function, acc, fun),
2198+
def reduce(function, acc, fun) when is_function(function, 2),
21992199
do: function.(acc, fun)
22002200
def member?(_function, _value),
22012201
do: {:error, __MODULE__}

0 commit comments

Comments
 (0)