On 11/3/12, bearophile <[email protected]> wrote: > Now you can omit the type, this is very handy: > > struct Foo { int x; } > void main() { > auto data = [Foo(10), Foo(20), Foo(30)]; > foreach (const f; data) {} > }
That's really cool that we have this now. But this error message needs
to improve:
foreach (const f; data)
{
f.x++;
}
test.d(9): Error: can only initialize const member x inside constructor
It should be something like "cannot modify const member x".
