[Issue 2937] New: postblit not called for foreach arg over array of structs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 4 21:24:17 PDT 2009


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

           Summary: postblit not called for foreach arg over array of
                    structs
           Product: D
           Version: 2.029
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: cristian at zerobugs.org


The assertion fails in the following program (I was able to fix it in my
back-end for .NET but it is probably best for a fix to go into the front-end).

struct X {
     int i;
     this(this) {
         ++i;
     }
}
void main() {
     X [1] xs;
     xs[0] = X();
     foreach(x; xs) {
         assert(x.i == 1);
     }
}


-- 



More information about the Digitalmars-d-bugs mailing list