https://issues.dlang.org/show_bug.cgi?id=14467
--- Comment #1 from Ketmar Dark <ket...@ketmar.no-ip.org> --- it looks right to me. consider this code: void main () { auto a0 = new int[10]; auto a1 = a0[5..$]; a1 ~= 42; a0 ~= 667; } here if `a1.capacity` will not be 0, the last item of `a1` will become `667`, as druntime will reuse memory for `a0`, and that memory is already used by `a1`. as there is no dataflow analysis, compiler can't tell if `arr` in your case is the only ref to the array. so compiler conservatively sets slice capacity to `0`, triggering copy-on-append behavior. --