✓
Passing This code compiles and runs correctly.
Code
// Test 310_040: Opaque Events Are Skipped By Taps
//
// Demonstrates that events marked [opaque] are NOT wrapped by taps.
// This prevents infinite recursion when internal implementation events
// are called from within tap handlers.
//
// Example: A universal tap (* -> *) should not tap [opaque] events,
// allowing internal events (like emit_transition in CCP) to be called
// safely from tap handlers without creating infinite loops.
const std = @import("std");
~import std/taps
// Public event - will be tapped
~tor hello {}
// Internal event - marked opaque to prevent tapping
~[opaque] tor internal-log { msg: string }
~proc hello|zig {
std.debug.print("Hello\n", .{});
}
~proc internal-log|zig {
std.debug.print("[INTERNAL] {s}\n", .{msg});
}
// Universal tap - should wrap hello() but NOT internal-log()
~tap(* -> *)
| Profile p |> internal-log(msg: p.source)
// Call hello - tap should fire and call internal-log
// The internal-log call from the tap should NOT be wrapped again
// (it's opaque, so tap won't try to tap it)
~hello()
Actual
[INTERNAL] koru:start
Hello
[INTERNAL] input:hello
[INTERNAL] koru:end
Expected output
[INTERNAL] koru:start
Hello
[INTERNAL] input:hello
[INTERNAL] koru:end
Flows
flow ~tap click a branch to expand · @labels scroll to their anchor
tap (* -> *)
flow ~hello click a branch to expand · @labels scroll to their anchor
hello
Test Configuration
MUST_RUN