✓
Passing This code compiles and runs correctly.
Code
// Test 350_016: bare-return head bind, then construct (`: v => branch v`).
//
// A subflow whose head is a bare-return (`-> T`) event binds the produced
// value with `:` and immediately constructs the outer event's branch from it:
// ~proc1 = mk(x: n): v => ok v
// The `=> ok v` construct must survive parsing as a void-branch continuation
// (it has no `| branch binding` wrapper — the `: v` bind moved to the head).
// Previously the orphaned `=>` was dropped and the handler never returned.
const std = @import("std");
~import std/io
~event mk { x: i32 } -> i32
~proc mk|zig { return x * 2; }
~event proc1 { n: i32 }
| ok i32
~proc1 = mk(x: n): v => ok v
~proc1(n: 21)
| ok r |> std/io:print.ln("result: {{ r:d }}")
Actual
result: 42
Expected output
result: 42
Flows
subflow ~proc1 click a branch to expand · @labels scroll to their anchor
mk (x: n)
flow ~proc1 click a branch to expand · @labels scroll to their anchor
proc1 (n: 21)
Test Configuration
MUST_RUN