✓
Passing This code compiles and runs correctly.
Code
// PINS: branch coverage is checked wherever a branching tor is invoked, not
// only at a flow head.
//
// `step` declares two branches and no return type, so there is no value to bind
// and `: v` is not a legal spelling for it. The mistake sits one position down
// the chain, behind `seed()`, and must be refused there exactly as it is at a
// head.
//
// TWO passes implement this rule and they word it differently. check-flow says
// "required branch 'again' not handled - event 'step' requires this branch"
// (flow_checker.zig:1527); check-structure says "branch 'again' must be handled
// but no continuation found" (shape_checker.zig, the missing-branches loop).
// check-structure runs FIRST (compiler.kz:1226) and now reaches this position —
// its pipeline walk used to be skipped whenever the flow HEAD was a bare-return
// tor, which `seed(): n0` is — so its sentence is the one that fires. Same code
// (KORU022), same branch named, earlier pass.
//
// 330_074 is the same fault behind a `#loop` head. 210_166 is NOT this: its
// branches are all handled, and it fails in capture emission for a legal
// program.
~import std/io
~tor seed {} -> i64
~proc seed|zig { return 0; }
~tor step { n: i64 }
| again i64
| stop i64
~proc step|zig {
if (n < 3) return .{ .again = n + 1 };
return .{ .stop = n };
}
~seed(): n0 |> step(n: n0): v |> std/io:print.ln("bound {{ v:d }}")
Must fail at runtime:
Program must error when executed.
Flows
flow ~seed click a branch to expand · @labels scroll to their anchor
seed
Test Configuration
Expected Error:
branch 'again' must be handled but no continuation found