http://d.puremagic.com/issues/show_bug.cgi?id=6934



--- Comment #2 from Don <clugd...@yahoo.com.au> 2011-11-19 12:24:51 PST ---
In fact passing arrays by reference is broken in non-trivial cases.

Changing the test case to include an index or slice assignment reveals
wrong-code problems:

void bar6934(ref int[] p) {
    p[0] = 12;
    assert(p[0] == 12); // fails!!!
    p[0..1] = 17;
    assert(p[0] == 17); // fails!!! 
    p = p[1..$];
}

This applies to any complicated passing of an array by ref (any dotvar or index
expression, or combination thereof).
It applies to array index assignment, and slice assignment.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to