SM
defmodule Playground do
@type t :: integer()
end
defmodule Playground.Macro do
defmacro m({{:".", _, [module, _type] }, _, []}) do
module = Macro.expand(module, __CALLER__)
IO.inspect Code.Typespec.fetch_types(module), label: :here
end
end
defmodule Playground2 do
require Playground.Macro
def f() do
Playground.Macro.m(Playground.t())
end
end
Выведет
here: :error
при компиляцииCode.ensure_compiled
перед Code.Typespec.fetch_types
? UPD: Не работает