Files
c3c/test/test_suite/compile_time/ct_switch_errors.c3
Christoffer Lerno 2439405e70 - $foreach "()" replaced by trailing ":" $foreach ($x, $y : $foo) -> $foreach $x, $y : $foo:
- `$for` "()" replaced by trailing ":" `$for (var $x = 0; $x < FOO; $x++)` -> `$for var $x = 0; $x < FOO; $x++:`
- `$switch` "()" replaced by trailing ":" `$switch ($Type)` -> `$switch $Type:`
- Empty `$switch` requires trailing ":" `$switch` -> `$switch:`
2025-03-04 16:13:47 +01:00

36 lines
577 B
Plaintext

fn void test()
{
$switch 3:
$case 2:
return;
$default: // #error: $default must be last in a $switch
$default:
return;
$endswitch
}
fn void test1()
{
$switch 1:
$case -1:
return;
$case -1: // #error: '-1' appears more than once
return;
$default:
return;
$endswitch
}
fn void test3()
{
$switch 3:
$case 3:
return;
$case 123.0: // #error: 'int'
return;
$default:
return;
$endswitch
}