dmd/compiler/test/fail_compilation/switches.d
Nick Treleaven d745b3499a Improve switch skipping variable errors
Use supplemental line to show location of variable.
Break out skip tests from switches.d test to new file.
Make switches.d test use only one TEST_OUTPUT block for AUTO_UPDATE
compat.
2023-08-07 15:15:59 +01:00

29 lines
419 B
D

/*
TEST_OUTPUT:
---
fail_compilation/switches.d(14): Error: `case 2` not found
fail_compilation/switches.d(25): Error: no `case` statement following `goto case;`
---
*/
void test1(int i)
{
switch (i)
{
case 1:
goto case 2;
defaut:
break;
}
}
void test2(int i)
{
switch (i)
{
case 1:
goto case;
defaut:
break;
}
}