✓
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 {} -> []const u8
~event goodbye {} -> []const u8
~event observer {}
~proc hello|zig {
std.debug.print("hello\n", .{});
return "go";
}
~proc goodbye|zig {
std.debug.print("goodbye\n", .{});
return "go";
}
~proc observer|zig {
std.debug.print("TAP FIRED!\n", .{});
}
// Tap on goodbye - should fire even when goodbye is nested
~tap(goodbye -> *): v |> observer()
// hello is top-level, goodbye is NESTED in hello's continuation
~hello(): _ |> goodbye()
Actual
hello
goodbye
TAP FIRED!
Expected output
hello
goodbye
TAP FIRED!
Flows
flow ~tap click a branch to expand · @labels scroll to their anchor
tap (goodbye -> *)
flow ~hello click a branch to expand · @labels scroll to their anchor
hello
Test Configuration
MUST_RUN