Skip to content

Commit 8e8c9a7

Browse files
committed
Wrap Range.new in Function.identity to avoid tail call optimization
1 parent 36c06c3 commit 8e8c9a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4066,7 +4066,7 @@ defmodule Kernel do
40664066
end
40674067

40684068
defp stepless_range(nil, first, last, _caller) do
4069-
quote(do: Elixir.Range.new(unquote(first), unquote(last)))
4069+
quote(do: Function.identity(Elixir.Range.new(unquote(first), unquote(last))))
40704070
end
40714071

40724072
defp stepless_range(:guard, first, last, caller) do

0 commit comments

Comments
 (0)