[Issue 13381] Two cases of array literal that can be stack-allocated
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Nov 29 13:47:56 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=13381
--- Comment #17 from Nick Treleaven <nick at geany.org> ---
Allowing comment #13 code depends on fixing Issue 20712.
> and comment #19 do not.
I meant comment #15 does not:
> immutable int[5] a2 = a1[0 .. i] ~ 3 ~ a1[i .. $];
I don't see how that could be allowed because `i` is a runtime value, so the
compiler has to make a GC array allocation (at least in the general case).
--
More information about the Digitalmars-d-bugs
mailing list