Files
c3c/test/test_suite/expressions/optional_panic_in_switch.c3t
Christoffer Lerno 414c0c9438 - Initializer did not correctly handle second rethrow #2870
- Crash encountering panic in if-else style switch #2871
2026-01-28 22:56:59 +01:00

21 lines
251 B
Plaintext

faultdef BAD_STUFF, WORSE_STUFF, THE_WORST_STUFF;
fn int exitcode(fault )
{
switch
{
case THE_WORST_STUFF~!!:
default: return 70;
}
}
fn void? canFail()
{
}
fn int main()
{
if (catch err = canFail())
{
return exitcode(err);
}
return 0;
}