✓
Passing This code compiles and runs correctly.
Code
// Pins the CHOKE's RUNTIME catch (210_151 only proves it structurally — no stage
// there ever fails). A point-free chain where stage-a can produce `| failed`;
// the dedented `| failed` choke claims it across the chain; a failing call is
// caught. stage-a(-5) fails → desugar's replicated choke routes it → run
// produces `failed` → call site prints "caught: negative".
~import std/io
~pub tor stage-a { ctx: i64 }
| ctx i64
| failed string
~proc stage-a|zig {
if (ctx < 0) return .{ .failed = "negative" };
return .{ .ctx = ctx + 1 };
}
~pub tor stage-b { ctx: i64 }
| ctx i64
| failed string
~proc stage-b|zig { return .{ .ctx = ctx * 2 }; }
~pub tor run { ctx: i64 }
| ctx i64
| failed string
~run = stage-a
|> stage-b
| failed f => failed f
~run(ctx: -5)
| ctx c |> std/io:print.ln("ok {{ c:d }}")
| failed f |> std/io:print.ln("caught: {{ f:s }}")
Actual
caught: negative
Expected output
caught: negative
Flows
subflow ~run click a branch to expand · @labels scroll to their anchor
stage-a
flow ~run click a branch to expand · @labels scroll to their anchor
run (ctx: -5)
Test Configuration
MUST_RUN