Andrej Mitrovic:
> I did have a bug pop up because I was relying on this new fallthrough
> warning system, but it failed to warn me because I didn't have a
> statement in one of my cases (I forgot to put a break).
-.- This is the consequence of special cases piled on special cases, in the D
desi
On Monday, November 07, 2011 15:38 Andrej Mitrovic wrote:
> import std.stdio;
>
> void main()
> {
> int y;
> switch (y)
> {
> case 0:
> {
> // no warning here on fallthrough
> }
>
> case 1:
> {
> goto case 2;
> }
>
> case 2:
> {
> writeln("2");
> break;
> }
>
> default:
> }
> }
>
> This won't
import std.stdio;
void main()
{
int y;
switch (y)
{
case 0:
{
// no warning here on fallthrough
}
case 1:
{
goto case 2;
}
case 2:
{
writeln("2");
break;
}