[Issue 4231] New: Solidary opUnary Postincrement and Postdecrement user defined operators are broken.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 24 21:45:43 PDT 2010


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

           Summary: Solidary opUnary Postincrement and Postdecrement user
                    defined operators are broken.
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P3
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: sandford at jhu.edu


--- Comment #0 from Rob Jacques <sandford at jhu.edu> 2010-05-24 21:45:40 PDT ---
It appears that the operator re-writing for the opUnary Post increment and Post
decrement operators is incorrect for single line expressions.

struct Foo{
    int opUnary(string op)() { return 1; }
}

void main() {
    Foo foo;
    foo++;   // Error: var has no effect in expression (__tmp608)

}

I've marked this as a regression since this was possible (and still is) using
the old operator overloading style.

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


More information about the Digitalmars-d-bugs mailing list