Skip to content

unquote functions report no docs/specs #44

@ackerdev

Description

@ackerdev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions