✓
Passing Passing: the compiler rejects this program as expected.
Code
// Pins a hole in when-guard arm-group emission: sibling arms on the
// same branch share ONE payload-capture decision, taken from the FIRST
// arm's binding. `| boom _ when left > 0` discards the payload, so the
// group emits `.boom =>` with no `|f|` capture — but the unguarded
// fallback `| boom f => boom f` still references `f`, and Zig refuses
// the emit: `error: use of undeclared identifier 'f'`.
//
// The shape is the supervision retry policy: a guarded arm absorbs the
// crash while budget remains and the fallback lets the last failure
// proceed upward — the fallback is where the payload matters.
import std/io
pub tor worker { n: i64 }
| ok i64
| ?!boom i64
worker = if(n < 0)
| then => boom n
| else => ok n
tor attempt { n: i64, left: i64 }
| ok i64
| more { n: i64, left: i64 }
| boom i64
attempt = worker(n)
| ok v => ok v
| boom _ when left > 0 => more { n: n + 4, left: left - 1 }
| boom f => boom f
pub tor sup { n: i64 }
| ok i64
| ?!boom i64
sup = #retry attempt(n, left: 3)
| more s |> @retry(s.n, s.left)
| ok v => ok v
| boom f => boom f
sup(n: -10)
| ok r |> std/io:print.ln("got {{ r:d }}")
| boom f |> std/io:print.ln("gave up {{ f:d }}")
Actual compiler output
🎯 Compiler coordination: Passes: 20 (flow-based: elaborate, analysis, emission)
Error: output_emitted.zig:147:33: error: use of undeclared identifier 'f'
else .{ .boom = f },
^Must fail at backend compile:
Code generation must reject the program.
Error output must contain
use of undeclared identifierFlows
subflow ~worker click a branch to expand · @labels scroll to their anchor
if (n < 0)
subflow ~attempt click a branch to expand · @labels scroll to their anchor
worker (n)
subflow ~sup click a branch to expand · @labels scroll to their anchor
#retry attempt (n, left: 3)
flow ~sup click a branch to expand · @labels scroll to their anchor
sup (n: -10)
Test Configuration
MUST_ERROR