Interfaces.jl
Interfaces.jl copied to clipboard
Defining multiple interfaces for one type
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:
https://github.com/rafaqz/Interfaces.jl/blob/b6191a05e35ac25cd378b86984f31676810e7898/src/implements.jl#L53-L54
The logic for handling the interface argument to the macro:
https://github.com/rafaqz/Interfaces.jl/blob/b6191a05e35ac25cd378b86984f31676810e7898/src/implements.jl#L70-L80
Thanks for your work on this package! Really appreciate the thought going into it.
I think the doc is just old and wrong. You can call @implements for multiple interfaces with the same object.
Got it. Seems like an easy thing to support, right? I could make a quick PR for it if you like.
I may be cleaner just to do separate calls? I'm ok with needing one line per interface.