[Issue 3345] Static and nonstatic methods with the same name should be allowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 4 05:59:42 UTC 2021


--- Comment #22 from Max Samukha <maxsamukha at gmail.com> ---
(In reply to Walter Bright from comment #15)
> > Otherwise there is no way to explain how .classinfo works in terms of D facilities.

> For code like this:
>     int fun() { return 1; }
>     static int fun() { return 2; }
> I cannot understand what purpose there is for writing such code.

It is a standard OOP practice. For example, 'Equals' in .NET's root class


More information about the Digitalmars-d-bugs mailing list