[Issue 1222] New: Cannot mixin scope guards

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 8 19:36:49 PDT 2007


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

           Summary: Cannot mixin scope guards
           Product: D
           Version: 1.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jrs7561 at louisiana.edu


Instead of mixing in the scope guard the line within the gaurd is executed. 

import std.stdio;

int main(char[][] args) {
    dummy();
    return 0;
}

void dummy() {
    mixin("scope(exit){writefln(\"should be last\");}"); //printed first
    writefln("should be first"); //printed last
}


-- 



More information about the Digitalmars-d-bugs mailing list