"davidl" <[email protected]> wrote in message
news:op.uugvg5ahj5j...@my-tomato...
[snip]
The culprit is the on stack array.
Should the compiler warn on slicing on a fixed length array? or even give
an error?
I find this use case can easily go wrong! You may even think this code is
correct at the very first glance.
Definately a bug. You should file it to bugzilla.
When returning the original stack-allocated array the compiler correctly
complains:
test.d(25): Error: escaping reference to local v
but as soon as you slice it, even "v[]", it is no longer detected.
Good catch!
L.