041 metatype profile binding

✓ Passing This code compiles and runs correctly.

Code

// Test 310_041: Profile Metatype Variable Binding
//
// Tests that Profile metatype variables are properly accessible in tap handlers.
// Profile provides: source, branch, destination, timestamp_ns (runtime info)
//
// 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 'p' is accessible in the handler invocation.

const std = @import("std");
~import "$std/taps"

~event hello {}
| done {}

~event logger { msg: []const u8 }
| done {}

~proc hello {
    std.debug.print("Hello\n", .{});
    return .{ .done = .{} };
}

~proc logger {
    std.debug.print("[PROFILE] {s}\n", .{msg});
    return .{ .done = .{} };
}

// Simple tap on concrete event (not wildcard) with Profile metatype
// If this works, metatype binding is OK
// If this fails with "undeclared identifier 'p'", metatype binding is broken
~tap(hello -> *)
| Profile p |> logger(msg: p.source)
    | done |> _

~hello()
| done |> _
input.kz

Expected Output

Hello
[PROFILE] input:hello

Test Configuration

MUST_RUN