Overriding of inherited class static methods?

DefinitelyNotAVtable DefinitelyNotAVtable at gmail.com
Thu Jul 23 07:55:29 UTC 2026


On Tuesday, 21 July 2026 at 10:51:30 UTC, Denis F wrote:
> Hi!
>
> Can anyone remind me why D doesn't provides overriding of 
> static methods?
> Is there some fundamental problem with this?
>
> I think it would be great in itself and also intuitive.

If static members became polymorphic, static would stop meaning 
"belongs to the type" and would start meaning "belongs to the 
type... unless the object has a better idea."

Of course, D has some history here ... since a private/protected 
member also "belongs to the type... unless other code outside the 
type has a better idea."

So who knows, maybe D will do this as well, one day - just to 
confuse us OO programmers even more.




More information about the Digitalmars-d mailing list