[Issue 17800] [2.076] "static foreach" allocates closures in GC without reason

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Sep 2 07:05:37 UTC 2017


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

--- Comment #1 from Илья Ярошенко <ilyayaroshenko at gmail.com> ---
struct S
{
    enum N = 1;
}

S foo(S v) @nogc
{
    static foreach(_; 0 .. typeof(return).N)
    {
    }
    return S.init;
}
----
Error: cannot use typeof(return) inside function __lambda1 with inferred return
type

--


More information about the Digitalmars-d-bugs mailing list