www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6590] New: mixed in case and default statements do not create a new scope

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

           Summary: mixed in case and default statements do not create a
                    new scope
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



consider

void main(){
    int x;
    switch(x){
        case 0: auto e=1; break;
        case 1: auto e=2; break; // fine
        default: auto e=3; break; // fine
    }
    switch(x){
        case 0: auto e=1; break;
        mixin("case 1:"); auto e=2; break; //error
        mixin("default:"); auto e=3; break;// error
    }
}

tested with DMD 2.054

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 01 2011