void foo(uint n, in uint[] x) { auto y = new uint[x[n]]; } void main() { foo(new uint[10]); } Error: need size of rightmost array, not type x[n]
This is a parsing error. Workaround: Adding () around the x[n] allows it to compile. void foo(uint n, in uint[] x) { auto y = new uint[ (x[n]) ]; } void main() { foo(7, new uint[10]); }
*** This issue has been marked as a duplicate of issue 783 ***