✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// Test 055b: Flow checker validation of when-clauses
// Tests that the flow_checker correctly validates when-clause exhaustiveness:
// - ACCEPTS: Multiple continuations with when-clauses + exactly one else
// - REJECTS: Multiple continuations with when-clauses but NO else (tested separately)
// ============================================================================
~tor check { x: i32, y: i32 }
| high i32
| low i32
~check => high x
// Valid: Two when-clauses + one else case
~check(x: 10, y: 5)
| high h when h.x > 10 |> _
| high h when h.x > 5 |> _
| high _ |> _ // else case
| low _ |> _
Must fail at backend compile:
Code generation must reject the program.
Flows
flow ~check click a branch to expand · @labels scroll to their anchor
check (x: 10, y: 5)