[Issue 12932] Support @nogc for immediately iterated array literal

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 16 08:46:53 PDT 2014


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

--- Comment #5 from bearophile_hugs at eml.cc ---
A better example:

struct F { int x; }
void main() @nogc {
    foreach (       a; [[1]]) {}  // Error
    foreach (int[1] a; [[1]]) {}  // Error
    foreach (       a; [F(1)]) {} // OK
}

--


More information about the Digitalmars-d-bugs mailing list