Skip to content

Commit 7a1a3ab

Browse files
committed
Prevent crash on zero arity def in protocol
1 parent e4f7ee4 commit 7a1a3ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/lib/protocol.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ defmodule Protocol do
666666
end
667667

668668
new_signatures =
669-
for {{fun, arity}, :def, _, _} <- definitions do
669+
for {{fun, arity}, :def, _, _} when arity > 0 <- definitions do
670670
rest = List.duplicate(Descr.term(), arity - 1)
671671
{{fun, arity}, {:strong, nil, [{[domain | rest], Descr.dynamic()}]}}
672672
end

0 commit comments

Comments
 (0)