✓
Passing This code compiles and runs correctly.
Code
// Test 310_043: Audit Metatype Variable Binding
//
// Tests that Audit metatype variables are properly accessible in tap handlers.
// Audit provides: source (event name), branch (branch taken)
//
// This isolates the metatype binding issue from wildcard pattern matching.
// The tap pattern is simple (concrete: hello -> *) so we're ONLY testing
// that the metatype variable 'a' is accessible in the handler invocation.
const std = @import("std");
~import "$std/taps"
~event hello {}
| done {}
~event logger {}
| done {}
~proc hello {
std.debug.print("Hello\n", .{});
return .{ .done = .{} };
}
~proc logger {
std.debug.print("[AUDIT] captured\n", .{});
return .{ .done = .{} };
}
// Simple tap on concrete event with Audit metatype
// If this works, metatype binding is OK - the variable 'a' is accessible
// If this fails with "undeclared identifier 'a'", metatype binding is broken
~tap(hello -> *)
| Audit _ |> logger()
| done |> _
~hello()
| done |> _
Expected Output
Hello
[AUDIT] captured
Test Configuration
MUST_RUN