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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 26 10:37:07 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3345

           Summary: Static and nonstatic methods with the same name should
                    be allowed
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrei at metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei at metalanguage.com> 2009-09-26 10:37:06 PDT ---
Consider:

class Widget {
    int fun() { return 1; }
    static int fun() { return 2; }
}

void main() {
    writeln(Widget.fun());       // should print 2
    writeln((new Widget).fun()); // should print 1
}

This should work. Otherwise there is no way to explain how .classinfo works in
terms of D facilities.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list