www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17800] New: [2.076] "static foreach" allocates closures in GC


          Issue ID: 17800
           Summary: [2.076] "static foreach" allocates closures in GC
                    without reason
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ilyayaroshenko gmail.com

struct S
    enum N = 1;

void foo(S v)  nogc
    static foreach(_; 0 .. v.N)

Error: function mir.ndslice.slice.foo is  nogc yet allocates closures with the
foo.__lambda2.__lambda1 closes over variable v

Sep 01