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:"++")() { this.x++; 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)
*** This issue has been marked as a duplicate of issue 4231 ***