If my case is
defmacro apple(clause) do
quote generated: true do
if unquote(clause) == :ok do
:ok
else
:failure
end
end
end
fruits do
apple :ok
apple :something_else
end
apple :ok
According to your method, it generate these lines:
-file("lib/store_front.ex", 1).
-module('Elixir.StoreFront').
-compile([no_auto_import]).
-export(['__info__'/1, run/0, run_fruits/0]).
-spec '__info__'(attributes | compile | functions |
macros | md5 | module | deprecated) -> any().
'__info__'(module) -> 'Elixir.StoreFront';
'__info__'(functions) -> [{run, 0}, {run_fruits, 0}];
'__info__'(macros) -> [];
'__info__'(Key = attributes) ->
erlang:get_module_info('Elixir.StoreFront', Key);
'__info__'(Key = compile) ->
erlang:get_module_info('Elixir.StoreFront', Key);
'__info__'(Key = md5) ->
erlang:get_module_info('Elixir.StoreFront', Key);
'__info__'(deprecated) -> [].
run() ->
'Elixir.IO':inspect(erlang:apply('Elixir.StoreFront',
run_fruits, [])).
run_fruits() ->
case ok == ok of
false -> failure;
true -> ok
end,
case something_else == ok of
false -> failure;
true -> ok
end.
:ok
I could see the root cause right now, however I’m wondering how other libraries e.g. ExUnit didn’t emit the same warning.
Here the problem is no matter things I put next to apple
macro under fruits
, it emits warning messsages.