https://issues.dlang.org/show_bug.cgi?id=13116
--- Comment #5 from [email protected] --- As Kenji points out, this is part of a more general problem where `super` and `this` in class methods are lvalues, so they are liable to illegal rebindings: ---- class Base { int x; } void rebind(ref Base b) { b = new Base; } void rebind(ref Derived d) { d = new Derived; } class Derived : Base { int y; void evil() { rebind(super); x = 123; // this modifies a different copy of Base.x than this one! rebind(this); y = 123; // this modifies a different copy of this.y ! } } ---- This problem can be solved if we make `this` and `super` rvalues in class methods. Note that in struct methods, `this` is OK to be an lvalue, because structs are by-value types so no rebinding is involved in the struct analog of the above code; it modifies the struct in-place. --
