✓
Passing This code compiles and runs correctly.
Code
// Test 310_042: Tap Nested Invocation
//
// CRITICAL: Taps must work on NESTED invocations, not just top-level flows.
// This is essential for profiling/observability - you want to tap ALL calls
// to an event, regardless of where they appear in the call graph.
//
// Structure:
// ~hello() | said _ |> goodbye() | said _ |> _
//
// The tap on 'goodbye' should fire even though goodbye() is nested
// inside hello()'s continuation, not a top-level flow.
const std = @import("std");
~import std/taps
~event hello {}
| said []const u8
~event goodbye {}
| said []const u8
~event observer {}
~proc hello|zig {
std.debug.print("hello\n", .{});
return .{ .said = "go" };
}
~proc goodbye|zig {
std.debug.print("goodbye\n", .{});
return .{ .said = "go" };
}
~proc observer|zig {
std.debug.print("TAP FIRED!\n", .{});
}
// Tap on goodbye - should fire even when goodbye is nested
~tap(goodbye -> *)
| said _ |> observer()
// hello is top-level, goodbye is NESTED in hello's continuation
~hello()
| said _ |> goodbye()
| said _ |> _
Actual
hello
goodbye
TAP FIRED!
Expected output
hello
goodbye
TAP FIRED!
Test Configuration
MUST_RUN