✓
Passing This code compiles and runs correctly.
Code
// Test: Braceless branch constructors in flow continuations
//
// This tests the identity branch constructor syntax INSIDE flows:
// | branch r |> done (empty identity)
// | branch r |> result r.value (identity with expression)
//
// This complements 100_052 which tests subflow syntax.
~import std/io
// Source event
~pub tor compute { x: i32 } -> i32
~proc compute|zig {
return x * 2;
}
// Result event with identity branches
~pub tor result {} -> i32
// Wrapper that uses braceless constructors in continuations
~pub tor run-test {}
~proc run-test|zig {
// This internally tests braceless continuation constructors
}
// Subflow using braceless identity in continuation
~tor process { input: i32 } -> i32
~process = compute(x: input): v -> v
// Main test
~std/io:print.ln("Testing braceless in continuation:")
~process(input: 21): r |> std/io:print.ln(" Got result: {{ r:d }}")
Actual
Testing braceless in continuation:
Got result: 42
Expected output
Testing braceless in continuation:
Got result: 42
Flows
subflow ~process click a branch to expand · @labels scroll to their anchor
compute (x: input)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "Testing braceless in continuation:")
flow ~process click a branch to expand · @labels scroll to their anchor
process (input: 21)
Test Configuration
MUST_RUN