✗
Failing This test is currently failing.
Failed: frontend
Failure Output
error[PARSE003]: single continuation branch 'matched' carrying a payload is a one-variant tag union — declare the single output as a bare return instead: `-> <type>`
--> tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_049_invocation_meta/input.kz:9:1
|
9 | ~[comptime]pub tor check-config { meta: InvocationMeta }
| ^ Code
// Test: InvocationMeta provides call site metadata for comptime introspection
// This enables conditional compilation based on flow annotations
~import std/io
const std = @import("std");
// A comptime event that receives metadata about its invocation
~[comptime]pub tor check-config { meta: InvocationMeta }
| matched string
~proc check-config|zig {
// meta.annotations contains the flow annotations like ["release"], ["debug"]
// meta.path contains the full path like "check_config"
// meta.location contains the source location
if (meta.annotations.len > 0) {
// Return the first annotation as the config name
return .{ .matched = meta.annotations[0] };
} else {
}
}
// Test 1: Invocation with [release] annotation
~[release]check-config()
| matched _ |> std/io:print.ln("Config: release")
| no-annotation |> std/io:print.ln("No config")
// Test 2: Invocation with [debug] annotation
~[debug]check-config()
| matched _ |> std/io:print.ln("Config: debug")
| no-annotation |> std/io:print.ln("No config")
// Test 3: Invocation without annotation
~check-config()
| matched _ |> std/io:print.ln("Config: unexpected")
| no-annotation |> std/io:print.ln("No config (expected)")
Flows
flow ~check-config click a branch to expand · @labels scroll to their anchor
check-config
flow ~check-config click a branch to expand · @labels scroll to their anchor
check-config
flow ~check-config click a branch to expand · @labels scroll to their anchor
check-config
Test Configuration
MUST_RUN