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

           Summary: non-static opCall runs in initialization incorrectly
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2012-10-24 22:41:21 PDT ---
import core.stdc.stdio : printf;
struct S
{
    int value = 10;
    S opCall(int n) // non-static
    {
        printf("this.value = %d\n", this.value);    // prints garbage!
        S s;
        s.value = n;
        return s;
    }
}
void main()
{
    S s = 10;   // calls instance opCall incorrectly
}

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

Reply via email to