Issue found by Ali Çehreli: http://forum.dlang.org/thread/kh3dkf$22eb$1@digitalmars.com DMD 2.063alpha accepts this code, ignoring the immutable(): struct Foo { int[] arr; this(int[] arr_) { this.arr = arr_; } } void main() { auto arr = [1]; auto f = immutable(Foo)(arr); pragma(msg, typeof(f)); // Prints: Foo f.arr[0]++; }
Thanks bearophile... Note that the bug disappears when the constructor is removed.
*** This issue has been marked as a duplicate of issue 6578 ***