✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// VERIFIED REGRESSION TEST - DO NOT MODIFY WITHOUT DISCUSSION
// ============================================================================
// Test 505: Tap shorthand syntax
// Tests that `~tap(event)` is equivalent to `~tap(event -> *)`
// The shorthand omits `-> *` when observing all branches.
~import std/io
~import std/taps
// Simple event with one branch we care about
~event ping {}
| pong []const u8
~proc ping|zig {
return .{ .pong = "Pong!" };
}
// SHORTHAND: ~tap(ping) instead of ~tap(ping -> *)
~tap(ping)
| pong _ |> std/io:print.ln("Tap observed pong")
// Main flow
~ping()
| pong p |> std/io:print.ln(p)
Actual
Tap observed pong
Pong!
Expected output
Tap observed pong
Pong!
Test Configuration
MUST_RUN