int[] test() { int[] x; int[3] y; x = y = [1, 2, 3]; return x; } void fill() { int[100] x; } void main() { auto a = test(); fill(); assert(a[0] == 1); assert(a[1] == 2); assert(a[2] == 3); }
Don't need all that file: int[] test() { int[] x; int[3] y; x = y = [1, 2, 3]; return x; } Is enough to reproduce (I believe it is the x = y = [1,2,3] line).
With dmd head, I am unable to reproduce the assert failure. But it does still assert at runtime with the first example.
(In reply to comment #2) > But it does still > assert at runtime with the first example. And it should fail, as it is returning a pointer to a local. So, I'm going to close this as "worksforme" because the assert no longer trips.