Summary: Cannot compile an overloaded operator returning by ref
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Max Samukha <> 2010-09-24 07:35:00 
PDT ---
struct QString
    ref QString opOpAssign(string op : "+")(ref QString s)
        return this;        

void main()
    QString s;
    s += s; // fails
    s.opOpAssign!("+")(s); // compiles 

test.d(12): Error: variable test.QString.op only parameters or foreach
declarations can be ref

Compiles if the return type is omitted or the operator is called explicitly.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to