"H. S. Teoh" <[email protected]> wrote in message news:[email protected]... > What's the reason the following code doesn't compile? > > struct S { > const(int)[4] data; > this(const(int)[4] d) { > data = d; // this is line 4 > } > } > > void main() { > S s; > } > > Compiler error: > > test.d(4): Error: slice this.data[] is not mutable > > Shouldn't the assignment be valid in the ctor? > > > T
Static array assignments are converted to slice assignments waaay too early.
