www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9342] New: nested aggregates generate closures, even when they don't escape

http://d.puremagic.com/issues/show_bug.cgi?id=9342

           Summary: nested aggregates generate closures, even when they
                    don't escape
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: nilsbossung googlemail.com



---
This creates a closure over i:
---
void f() {
    int i;
    struct N {
        void makeNested() {++i;}
    }
    // maybe do something with N
}
---
Would be neat if it didn't.

For example, std.string.sformat suffers from this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 17 2013