✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// Test 055c: Flow checker rejects missing else case
// Tests that the flow_checker correctly REJECTS when-clauses without an else:
// - Multiple continuations with when-clauses but NO else case
// - Should fail with KORU050 error (non-exhaustive)
// ============================================================================
~event check { x: i32, y: i32 }
| high i32
| low i32
// Invalid: Two when-clauses but NO else case (non-exhaustive).
// The chain below is missing a `| high h |> _` else handler.
~check(x: 10, y: 5)
| high h when h.x > 10 |> _
| high h when h.x > 5 |> _
| low |> _
Expected
error[KORU050]: branch 'high' has multiple when-clauses but no else case - add one continuation without 'when'
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_007_flow_checker_missing_else/input.kz:14:0
|
14 | ~check(x: 10, y: 5)
| ^
Test Configuration
Expected Behavior:
FRONTEND_COMPILE_ERROR