http://d.puremagic.com/issues/show_bug.cgi?id=1339
------- Comment #4 from 2kor...@gmail.com 2009-02-19 03:27 ------- (In reply to comment #3) > It reallocated array on increasing length. Seems valid. > Yes, the length part is fine. Here is slightly modified test case: import std.stdio; import std.algorithm; void main() { immutable(int)[] x = [1, 5, 3, 4]; auto y = x; writefln(y); x.sort; writefln(y); // immutable variable is modified! x.reverse; writefln(y); } Problem is that sort and reverse work in-place, thus modifying immutable variable. It should either not compile /or/ allocate a copy. I don't like the hidden allocations, so this should be just disallowed, imo. --