On Tuesday, 3 May 2022 at 12:59:31 UTC, Alain De Vos wrote:
Error: array literal in @nogc function test.myfun may cause a GC allocation

@nogc void myfun(){
        scope int[] i=[1,2,3];
}//myfun

May is a fuzzy word...

It means if the compiler is free to allocate on the stack if possible. In practice, though, you can usually assume there will be a GC allocation.

Reply via email to