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

           Summary: "auto ref" doesn't work in one or more cases
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-06-01 10:11:15 PDT ---
I think this is a correct D2 program:


struct Vec {
    Vec opOpAssign(string Op)(auto ref Vec other) if (Op == "+=") {
        return this;
    }
    Vec opBinary(string Op:"+")(Vec other) {
        Vec result;
        return result += other;
    }
}
void main() {
    Vec v;
    v += Vec() + Vec(); // line 12
}


But DMD v2.046 prints:
temp.d(12): Error: function temp.Vec.opOpAssign!("+=").opOpAssign (auto ref Vec
other) is not callable using argument types (Vec)
temp.d(12): Error: (Vec()).opBinary((Vec())) is not an lvalue

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

Reply via email to