May 08, 2004
Any access to out/inout array function parameters in class foreach statement causes AV.

[code]
class A {
  int m = 0;
  int opApply(int delegate(inout int) dg) {
    return dg(m);
  }
}
void foo(out int[] q, A a) {
  q = new int[10];
  foreach(inout int e; a) {
    q[0] = 0; // access violation here!
  }
}
void main() {
  int[] a;
  foo(a, new A);
}
[/code]