On Thursday, 4 July 2019 at 10:56:50 UTC, Nick Treleaven wrote:
immutable(int[]) f() @nogc {
    return [1,2];
}

onlineapp.d(2): Error: array literal in `@nogc` function `onlineapp.f` may cause a GC allocation


specify the size of the static array:
immutable(int[ 2 /*HERE*/ ]) f() @nogc { return [1,2]; }

Reply via email to