https://issues.dlang.org/show_bug.cgi?id=21175
Dennis <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Dennis <[email protected]> --- N.b. this is relevant to dip1000, since this works: ``` @safe: struct S { int* x; void opAssign(return scope S other) scope { this.x = other.x; } } void main() { scope S b; scope S a; a = b; } ``` But this doesn't: ``` @safe: struct S { int* x; ref S opAssign(return scope S other) return scope { this.x = other.x; return this; } } void main() { scope S b; scope S a; a = b; } ``` source/apps/retscope.d(7): Error: scope variable `other` assigned to `this` with longer lifetime The return destination of `return scope S other` was `this` when `opAssign` returned `void`, but now the return destination is the return value. Example in Phobos: https://github.com/dlang/phobos/blob/62780daf85c4c57bbc805e1e6499a33a852a2802/std/datetime/systime.d#L696 The only reason this compiles currently is because of issue 20149 --
