The following allows a write to an immutable array: import std.stdio; void doSomething(const(char)[][] a, const(char)[][] b) { a[0]=b[0]; } void main() { string s = "hello"; char[][1] a; string[1] b; b[0] = s; doSomething(a, b); a[0][1] = 'c'; // OOPS! writeln(s); } So, a conversion to const that is not the top ref should be disallowed.
http://www.dsource.org/projects/dmd/changeset/299
Definitely duplicate of bug 2544.
I must've assumed every account on this bugzilla had the editbugs bit set.... *** This issue has been marked as a duplicate of issue 2544 ***
Fixed dmd 2.038