On Wednesday, 10 January 2018 at 22:46:30 UTC, ag0aep6g wrote:
If I understand correctly, the goal is to have the `int[]` itself on the GC heap.

The code
----
void main(string[] args) @nogc
{
    int[] x = [1, 2, 3];
}
----

won't compile, because "array literal in @nogc function 'D main' may cause GC allocation". But "may" isn't the same as "will". What determines it? That's a kind of goofy error message now that I think about it.

Reply via email to