Summary: opOpAssign and opIndexOpAssign get wrong operator
           Product: D
           Version: 2.041
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD

--- Comment #0 from Lars T. Kyllingstad <> 2010-03-08 
01:52:06 PST ---
The specification says:

    The expression: a op= b
    is rewritten as: a.opOpAssign!("op")(b)

A similar statement is made about opIndexOpAssign. However, what actually
happens is that the template parameter is set to "op=", as this program shows:

    struct S
        void opIndexOpAssign(string op)(int x, int i)
            pragma (msg, op);

        void opOpAssign(string op)(int x)
            pragma(msg, op);

    void main()
        S s;
        s[1] += 2;
        s += 3;

This prints the following on compilation:


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

Reply via email to