Polymorphic static methods/properties/etc #2285
-
Right now static members can't be referenced via an instance reference, but if you could do that, then they could take advantage of polymorphism to call a different method based on whatever type is implementing the interface. Can't think of a particular use case for this right now but I'll definitely add one when it comes to me! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Because that would make them instance methods? |
Beta Was this translation helpful? Give feedback.
-
So you also proposing to add a static members to interfaces? Or deriving of static members? Without either of this you proposal is pointless cause we should know somehow (with your 'polymorphism' approach) that all subclasses implements (overrides?) this static member. So deriving of static members is essential for your proposal. |
Beta Was this translation helpful? Give feedback.
Because that would make them instance methods?