Skip to content

Commit 33035e9

Browse files
author
José Valim
committed
Address undefined macro if on bootstraping
1 parent 5f68202 commit 33035e9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,10 +2061,14 @@ defmodule Kernel do
20612061
true ->
20622062
raise ArgumentError, message: "cannot dynamically set attribute @#{name} inside function"
20632063
false ->
2064-
if name == :behavior do
2065-
IO.write :stderr, "warning: @behavior attribute is not supported, please use @behaviour instead\n" <>
2066-
Exception.format_stacktrace(env_stacktrace(env))
2064+
case name do
2065+
:behavior ->
2066+
IO.write :stderr, "warning: @behavior attribute is not supported, please use @behaviour instead\n" <>
2067+
Exception.format_stacktrace(env_stacktrace(env))
2068+
_ ->
2069+
:ok
20672070
end
2071+
20682072
quote do: Module.put_attribute(__MODULE__, unquote(name), unquote(arg))
20692073
end
20702074
end

0 commit comments

Comments
 (0)