https://issues.dlang.org/show_bug.cgi?id=19143
Issue ID: 19143 Summary: error or warn when assigning `this.foo = foo` when the lone foo is this.foo (i.e.not a constructor parameter) Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: iamthewilsona...@hotmail.com struct Foo { int i; this (int ii) { this.i = i; } } void main() { auto foo = Foo(2); import std.stdio : writeln; writeln(foo); // prints Foo(0); } should error or at least warn. It leads to very confusing behaviours (you think i is assigned but its not). --