https://issues.dlang.org/show_bug.cgi?id=3827

--- Comment #36 from yebblies <[email protected]> ---
(In reply to bearophile_hugs from comment #35)
> 
> I don't understand what you suggest me to file.

If the @nogc enforcement was done after constant folding, then that expression
wouldn't use the gc.  Same with things like `[1, 2, 3][0]`.

> A line of code "string s2 =
> "AB" ~ "CD";" performs a run-time array concatenation, that always performs
> a memory allocation, so it can't be @nogc.

Try it, look at the asm.  No memory allocation.

--

Reply via email to