https://issues.dlang.org/show_bug.cgi?id=15869
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code CC| |[email protected] Hardware|x86_64 |All OS|Linux |All Severity|enhancement |normal --- Comment #1 from [email protected] --- Slightly reduced: ---- struct Set { @disable this(this); int value = 0; } Set clobber(Set* a) { Set ret; // <- This overwrites *a, i.e. &ret is the same as a ret.value = a.value; // <- Now a.value is 0 return ret; } struct XX { Set a = Set(1); this(int n) { a = clobber(&a); } } void main(){ XX xx = XX(0); assert(xx.a.value == 1); /* fails */ } ---- --
