www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3144] New: Invalid break accepted

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

           Summary: Invalid break accepted
           Product: D
           Version: 2.031
          Platform: All
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: tim.matthews7 gmail.com


This break statement causes program to exit:

import std.stdio;

void main()
{
    int i = 1;
    switch (i)
       case 1: writeln("1"); break;


    writeln("exit");

}


It should instead report "Error: break is not inside a loop or switch" like it
does for this code:

void main()
{
   break; 
}

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