digitalmars.D.bugs - [Issue 15612] New: Break immutability with default initialisers
- via Digitalmars-d-bugs (34/34) Jan 26 2016 https://issues.dlang.org/show_bug.cgi?id=15612
https://issues.dlang.org/show_bug.cgi?id=15612 Issue ID: 15612 Summary: Break immutability with default initialisers Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: john.loughran.colvin gmail.com void main() { immutable S s0; S s1; assert(s0.c.a == 42); s1.c.a = -42; assert(s0.c.a == 42); //FAILS! } struct S { C c = new C(42); } class C { int a; this(int a) { this.a = a; } } --
Jan 26 2016