Is there a way to enforce an inheriting class prov...
# getting-started
h
Is there a way to enforce an inheriting class provides a static property?
🚫 3
b
i've found myself wanting the same thing. you can have the companion object implement an interface though, if that helps.
(it didn't in my case 😕 )
h
Yeah, in general I'd want the compiler to recognize that a class implementation has that static member
You can at the very least access static members of inheriting classes through reflection, accessing the property by the name, and recasting the erased type back into the one you expect, but that's really ugly and confusing to a reader