https://issues.dlang.org/show_bug.cgi?id=24162

--- Comment #7 from anonymous4 <dfj1es...@sneakemail.com> ---
(In reply to tomerfiliba from comment #2)
> accessing this memory location no longer does what it was meant to do.

If this function doesn't reflect your intention, then write a function that
reflects your intention, like:

@safe:
import std.stdio: writeln;

void f(int x, ref int[] arr) {
    arr[x] += 1;
    arr ~= new int[900000];
    arr[x] += 1;
}

void main() {
    auto arr = new int[10];
    f(2, arr);
    writeln(arr[0..10]);
}

--

Reply via email to