✓
Passing This code compiles and runs correctly.
Code
// Test: Event Wildcard Tap with Metatype
//
// Demonstrates that event wildcard taps (*:compute) must use metatypes
// like Profile, Transition, or Audit (not concrete branches).
//
// With metatype, the tap can observe any event named "compute" across modules
// and access the Profile metadata (source, branch, destination).
const std = @import("std");
~import std/taps
~import app/test_lib/logger
~event compute { x: i32 }
| result i32
~proc compute|zig {
return .{ .result = x * 2 };
}
// Event wildcard tap observes all compute events with metatype
~tap(*:compute -> *)
| Profile p |> app/test_lib/logger:log(msg: p.source)
~compute(x: 42)
| result _ |> _
Actual
[TAP] input:compute
[TAP] app.test_lib.logger:log
Expected output
[TAP] input:compute
[TAP] app.test_lib.logger:log
Imported Files
// Logger for event wildcard tap test
const std = @import("std");
~import std/taps
~pub event log { msg: []const u8 }
~proc log|zig {
std.debug.print("[TAP] {s}\n", .{msg});
}
// Event wildcard tap using metatype (valid usage)
~tap(*:log -> *)
| Profile p |> log(msg: p.source)
Test Configuration
MUST_RUN