❔ Default implementation of a `static abstract` base interface member in derived interface
I am trying to implement an idea I saw in MessagePack for C#:
where using
I came up with this:
Now- if
Can this interface now declare a default implementation of the static abstract members of
I know the derived interface can declare an explicit impl of the base interface method, but then the explicit impl is not available through the struct's type as I expect
If this is not the correct way to approach this, I'm open to all suggestions on how I can provide specialized behavior to structs in this particular instance. Thank you!
where using
static abstract surfaces the methods on the type itself, which I find very useful.I came up with this:
Now- if
T were a struct, I can provide good default impls, so I declare a derived interface that constrains T:Can this interface now declare a default implementation of the static abstract members of
IDispatchable<T> such that implementing structs surface that default implementation? I know the derived interface can declare an explicit impl of the base interface method, but then the explicit impl is not available through the struct's type as I expect
static abstract/virtual members to be.If this is not the correct way to approach this, I'm open to all suggestions on how I can provide specialized behavior to structs in this particular instance. Thank you!