rafaqz / Interfaces.jl

Macros to define and implement interfaces, to ensure they are checked and correct.
MIT License
72 stars 4 forks source link

Include the required supertype in interface declarations #26

Closed rafaqz closed 8 months ago

rafaqz commented 8 months ago

I'm thinking it may make sense if interface declarations have to include the required supertype, like:

@interface SomeInterface SomeType conditions docs

For interfaces without supertypes, like iteration, this would be Any

@interface IterationInterface Any conditions docs

Originally this was not included because the Any case is redundant. But now I think it might be nicely self documenting - wherever there is Any its a trait only interface.

@gdalle any thoughts?

gdalle commented 8 months ago

I like that idea! And it's probably a minor code change