Open rafaqz opened 4 months ago
Attention: Patch coverage is 34.54545%
with 36 lines
in your changes are missing coverage. Please review.
Project coverage is 74.23%. Comparing base (
071d44f
) to head (692b95b
).
Files | Patch % | Lines |
---|---|---|
src/interface.jl | 27.58% | 21 Missing :warning: |
src/implements.jl | 35.00% | 13 Missing :warning: |
src/test.jl | 66.66% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
One caveat here I havent really thought through is that any kind of inheritance necessitates that tests of all inherited interfaces accept the same objects
Mostly I think that will be fine, but may hit problems where mulitiple arguments are used
I'll check this out!
Sorry I did not take the time, will make a pass this week
No worries!
This PR implements multiple inheritance for
Interface
types storing the inherited types in a secondInherits
type parameter of the supertypeInterface
, and adding dispatch on the second type parameter in the@implements
macro so that inheriting types will have a fallback to the inherited types dispatch.The
Inherits
parameter can be aUnion
, so dispatch will work for multiple inherited interfaces. We flatten the inheritance when interfaces are chained (likeMyArrayInterface
inheritsArrayInterface
inheritsIterationInterface
) so everything is in oneUnion
rather than nested. So theInherits
parameter will beUnion{ArrayInterface,IterationInterface}
orUnion{ArrayInterface{(:some, :options)},IterationInterface}
. But the options are stripped byinherited_basetype
whenInherits
is used for dispatch.Needs docs and reorganisation/renaming of all the helper methods, it was hard to write so I imagine also hard to understand.
@gdalle if you have time for some feedback, that could help guiding how to document and explain this.
Closes #6