✓
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 event compute { x: i32 }
| value i32
~proc compute|zig {
return .{ .value = x * 2 };
}
// Result event with identity branches
~pub event result {}
| ok i32
// Wrapper that uses braceless constructors in continuations
~pub event run-test {}
~proc run-test|zig {
// This internally tests braceless continuation constructors
}
// Subflow using braceless identity in continuation
~event process { input: i32 }
| result i32
~process = compute(x: input)
| value v => result v
// Main test
~std/io:print.ln("Testing braceless in continuation:")
~process(input: 21)
| result 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
Test Configuration
MUST_RUN