Summary: opUnary("++") doesn't work
           Product: D
           Version: 2.041
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-03-15 10:17:47 PDT ---
According to the specs of the new operator overloading this program is correct,
but it currently doesn't compile:

struct Foo {
    int x;
    Foo opUnary(string op:"++")() {
        return this;
void main() {
    Foo f = Foo(5);
    f++; // line 10

The compiler gives:
test.d(10): Error: var has no effect in expression (__tmp1)

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

Reply via email to