www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1222] New: Cannot mixin scope guards

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: jrs7561 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
}


-- 
May 08 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1222


tomas famolsen.dk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE







*** This bug has been marked as a duplicate of 1025 ***


-- 
May 09 2007