✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test 355_015: MUST_ERROR — `|*` on a pure-effect tor refuses.
//
// `|*` routes OPTIONAL `|` outcome branches. A tor declaring only `!`
// effect links produces no outcome union to dispatch on — the residual
// has nothing to fall back from. It reads as "handle the rest" while
// nothing can ever reach it, which is the pay-for-nothing shape with a
// worse symptom: emission dropped the invocation entirely.
//
// Expected: KORU026 — the residual names a fallback for a union that
// does not exist.
~tor tokenize { source: string }
! token u32
! ?warn string
~proc tokenize|zig {
_ = source;
token(1);
}
~pub tor observe { name: string }
~proc observe|zig {
_ = name;
}
~tokenize(source: "x")
! token _ |> observe(name: "tok")
|* |> observe(name: "rest")
Actual compiler output
error[KORU026]: residual arm '|*' on 'tokenize' has no '|' outcome branches to catch — it routes optional outcome branches only
--> tests/regression/300_ADVANCED_FEATURES/355_OPTIONAL_BRANCHES/355_015_residual_pure_effect_refused/input.kz:26:0
|
26 | ~tokenize(source: "x")
| ^Must fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
has no '|' outcome branches to catchFlows
flow ~tokenize click a branch to expand · @labels scroll to their anchor
tokenize (source: "x")
Test Configuration
MUST_ERROR