Skip to content

Best way to use derive with typedstruct module: .... do #42

@tcoopman

Description

@tcoopman

This is what I want to write:

@derive Jason.Encoder
typedstruct module: Foo do
  field :bar, :string
end
> mix compile
warning: warning: module attribute @derive was set after defstruct, all @derive calls must come before defstruct

To fix it I have to use

require Protocol
Protocol.derive(Jason.Encoder, Foo)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions