Skip to content

Commit 0cdf6d2

Browse files
author
José Valim
committed
Consider that Macro may have not been bootstrapped
1 parent e4c1e3d commit 0cdf6d2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3028,9 +3028,15 @@ defmodule Kernel do
30283028
30293029
"""
30303030
defmacro first..last do
3031-
first = Macro.expand(first, __CALLER__)
3032-
last = Macro.expand(last, __CALLER__)
3033-
range(__CALLER__.context, first, last)
3031+
case bootstrapped?(Macro) do
3032+
true ->
3033+
first = Macro.expand(first, __CALLER__)
3034+
last = Macro.expand(last, __CALLER__)
3035+
range(__CALLER__.context, first, last)
3036+
3037+
false ->
3038+
range(__CALLER__.context, first, last)
3039+
end
30343040
end
30353041

30363042
defp range(_context, first, last) when is_integer(first) and is_integer(last) do

0 commit comments

Comments
 (0)