✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// VERIFIED REGRESSION TEST - DO NOT MODIFY WITHOUT DISCUSSION
// ============================================================================
// Test 503: Multiple events with mixed branch patterns
// Tests shape checker with combination of void and branching events
// Demonstrates: Complex flows with mixed event types
~import std/io
// Event with single output branch
~tor compute { x: i32 } -> i32
~proc compute|zig {
return x * 2;
}
// Event with two branches
~tor validate { n: i32 }
| valid
| invalid
~proc validate|zig {
if (n > 0) {
return .valid;
}
return .invalid;
}
// Mixed flow: void events, single-branch events, and multi-branch events
~std/io:print.ln("Starting computation")
~compute(x: 5): d |> validate(n: d)
| valid |> std/io:print.ln("Valid result")
| invalid |> std/io:print.ln("Invalid result")
~compute(x: -3): d |> validate(n: d)
| valid |> std/io:print.ln("Valid result")
| invalid |> std/io:print.ln("Invalid result")
~std/io:print.ln("Done")
Actual
Starting computation
Valid result
Invalid result
Done
Expected output
Starting computation
Valid result
Invalid result
Done
Flows
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "Starting computation")
flow ~compute click a branch to expand · @labels scroll to their anchor
compute (x: 5)
flow ~compute click a branch to expand · @labels scroll to their anchor
compute (x: -3)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "Done")
Test Configuration
MUST_RUN