dmd/compiler/test/fail_compilation/fail11653.d
2022-07-09 18:53:07 +02:00

26 lines
531 B
D

/*
TEST_OUTPUT:
---
fail_compilation/fail11653.d(18): Error: switch case fallthrough - use 'goto case;' if intended
fail_compilation/fail11653.d(23): Error: switch case fallthrough - use 'goto default;' if intended
---
*/
void main()
{
int test = 12412;
int output = 0;
switch(test)
{
case 1:
output = 1;
//break; //Oops..
case 2: .. case 3:
output = 2;
break;
case 4:
output = 3;
default:
output = 4;
}
}