✓
Passing This code compiles and runs correctly.
Code
// TEST: Auto-synthesized proc for passthrough events
//
// When an event has:
// - Single output branch
// - Input and output fields match exactly (name + type)
// - No proc defined
//
// The compiler should synthesize a passthrough proc.
~import "$std/io"
// Event with matching input/output - NO PROC DEFINED
~pub event passthrough { msg: []const u8 }
| done { msg: []const u8 }
// Verify event - has proc that validates the passthrough worked
~pub event verify { msg: []const u8 }
~proc verify {
// If passthrough worked, msg should be "42" not ""
if (std.mem.eql(u8, msg, "42")) {
std.debug.print("42\n", .{});
} else {
std.debug.print("FAIL: got '{s}'\n", .{msg});
}
}
const std = @import("std");
// Use it - passthrough should forward the value to verify
~passthrough(msg: "42")
| done d |> verify(msg: d.msg)
Test Configuration
Expected Behavior:
42