Skip to content

Can't use other modules macros while using decorator #37

@FrancescoZ

Description

@FrancescoZ

While using decorator with Spandex i'm not able to add another use in sequence:

defmodule Fetcher.Info do
  use Spandex.Decorators
  use Interceptor.Annotation

 @intercept true
 @decorate span(type: :backend)
 def retrieve_information(resource_uuid) do
      #mycode
 end
end

Using this code I get the following warning:

warning: this clause cannot match because a previous clause at line 1 always matches
  lib/fetcher/info.ex:1

Could it be useful to insert something like this?

Module.register_attribute __MODULE__, :decorate, accumulate: true

To allow the macros to be used as a list and not overwrite the previous.
I think this would also help the #29, what do you think?

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