[Issue 17865] New: property/non-property overloads not detected until used

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 28 18:44:00 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=17865

          Issue ID: 17865
           Summary: property/non-property overloads not detected until
                    used
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: nicolas.jinchereau at gmail.com

class C {
    @property void fun(int x){  }
    int fun(){ return 0; }
}

int main(string[] argv)
{
    C c = new C();
    //c.fun = 0;
    return 0;
}

This code should not compile, but it does.

You have to un-comment the second line of main before you get the proper error:

"Error: cannot overload both property and non-property functions"

--


More information about the Digitalmars-d-bugs mailing list