a way for interfaces and superclasses to define th...
# language-proposals
h
a way for interfaces and superclasses to define that an inheritor must have static members of its own of some type. AKA you have to have an object that extends as such
d
I'm guessing you want to access these methods polymorphically? You could make an interface for `companion object`s to inherit I guess and sprinkle some delegation.
r
@Hullaballoonatic Could you provide a use case? I'm having a hard time seeing why that would be useful.
h
you can't force inheritors to have constructors that take certain params, but maybe you could force inheritors to have an object of a type that has an
invoke
that takes those params
r
Why would you want to force that? Pretty much every time I hear of someone saying they want to enforce the shape of a constructor, it's usually the case they really just want to accept some sort of
(...params...) -> T
and let the consumer define how to construct the result.