Comment #0 by tim.matthews7 — 2009-07-06T20:55:44Z
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;
}
Comment #1 by yebblies — 2012-01-29T22:46:39Z
This is a parser bug, from what I can tell. dmd assumes that the statements inside a switch block are terminated with a '}', which isn't the case here.