Skip to content

Defining multiple interfaces for one type #55

Open
@ReubenJ

Description

@ReubenJ

The docs for @implements mention the ability to define a type as inheriting from multiple interfaces by supplying a vector of interfaces, but it appear that the macro only handles the cases: Interface{:option} or plain, single Interface.

Am I missing something?

The docstring mentioning it:

The macro can only be used once per module for any one type. To define
multiple interfaces a type implements, combine them in square brackets.

The logic for handling the interface argument to the macro:

if interface isa Expr && interface.head == :curly
interfacetype = interface.args[1]
optional_keys = interface.args[2]
# Allow a single Symbol instead of a Tuple
if optional_keys isa QuoteNode
optional_keys = (optional_keys.value,)
end
else
interfacetype = interface
optional_keys = ()
end

Thanks for your work on this package! Really appreciate the thought going into it.

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