✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test 355_016: MUST_ERROR — `|*` under a bare-return dispatch refuses.
//
// A `-> T` callee returns a value, not a tagged union — there are no `|`
// outcome branches for a residual to route. The arm reads as "handle
// whatever else comes back" but there is no else; emitted it ran
// unconditionally, an arm that fires on every call.
//
// Expected: KORU026 — no outcome branches exist to catch.
~pub tor mk { x: i64 } -> i64
~mk -> x + 1
~pub tor observe { name: string }
~proc observe|zig {
_ = name;
}
~mk(x: 1)
|* |> observe(name: "huh")
Actual compiler output
error[KORU026]: residual arm '|*' on 'mk' has no '|' outcome branches to catch — it routes optional outcome branches only
--> tests/regression/300_ADVANCED_FEATURES/355_OPTIONAL_BRANCHES/355_016_residual_bare_return_refused/input.kz:18:0
|
18 | ~mk(x: 1)
| ^Must fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
has no '|' outcome branches to catchFlows
flow ~mk click a branch to expand · @labels scroll to their anchor
mk (x: 1)
Test Configuration
MUST_ERROR