doctor
doctor copied to clipboard
`unquote` functions report no docs/specs
I have a module that generates functions from a list at compile time, but doctor does not recognize the doc and spec that exist, reporting my module has having a function that is missing both doc and spec.
Here's an example that should replicate the issue:
defmodule MyModule do
list = [:foo, :bar, :baz]
Enum.each(list, fn name ->
@doc """
Returns a string representation for #{name}.
iex> Foo.#{name}()
#{Atom.to_string(name)}
"""
@spec unquote(name)() :: binary()
def unquote(name), do: unquote(Atom.to_string(name))
end)
end
Technically it's 3 functions, but if doctor could simply report this as 1 function with doc and spec that would be adequate.