✓
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
~event compute { x: i32 }
| done i32
~proc compute|zig {
return .{ .done = x * 2 };
}
// Event with two branches
~event 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)
| done d |> validate(n: d)
| valid |> std/io:print.ln("Valid result")
| invalid |> std/io:print.ln("Invalid result")
~compute(x: -3)
| done 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
Test Configuration
MUST_RUN