✓
Passing This code compiles and runs correctly.
Code
// INVALID SHAPE by design: `=>` returns one of the EVENT's branches, and a
// void event like std/io:print.ln has no branches to return — the shape can
// never be satisfied, and the compiler must refuse it, always.
//
// The valid consumer spelling is the continuation: `| failed f |>
// std/io:print.ln(f)`. The `=>` arm's RHS must be a branch constructor
// (210_152's `| failed f => failed f`).
//
// Refused at parse: the braceless constructor path enforces the same
// single-identifier rule as the braced path (parseConstructionStep), so a
// call-shaped RHS — `std/io:print.ln(f)` — cannot ride along as a
// "payloadless constructor named 'std/io:print.ln(f)'" (previously the
// refusal was accidental: KORU100 from the choke replication).
~import std/io
~pub tor stage-a { ctx: i64 }
| ctx i64
| failed string
~proc stage-a|zig { if (ctx < 0) return .{ .failed = "neg" }; 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 => std/io:print.ln(f)
~run(ctx: 2)
| ctx c |> std/io:print.ln("ok {{ c:d }}")
| failed f |> std/io:print.ln("caught: {{ f:s }}")
Frontend must reject with:
CONTAINS PARSE003
CONTAINS invalid branch constructorFlows
flow ~run click a branch to expand · @labels scroll to their anchor
run (ctx: 2)