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.
*** This issue has been marked as a duplicate of issue 4041 ***