[Issue 5222] New: label prepending block in 'ThenStatement' breaks creating new scope

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 16 07:18:58 PST 2010


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

           Summary: label prepending block in 'ThenStatement' breaks
                    creating new scope
           Product: D
           Version: D1 & D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: elfy.nv at gmail.com


--- Comment #0 from Nick Voronin <elfy.nv at gmail.com> 2010-11-16 07:17:46 PST ---
//case 1
{
l1: {
 int v;
}
v = 5; // works, block after label does not introduce new scope
}

// case 2
{
while(1)
l2: {
 int v;
}
v = 5; // error, v is undefined, seems correct as 
// WhileStatement:
//    while ( Expression ) ScopeStatement
}

// case 3
{
if(1)
l3: {
 int v;
}
v = 5; // works! seems inconsistent and incorrect as 
// ThenStatement:
//    ScopeStatement
}

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


More information about the Digitalmars-d-bugs mailing list