✓
Passing This code compiles and runs correctly.
Code
// Test: Registry Scope - Typed Arguments
// Ensures runtime dispatch parses bool/float/int args correctly.
~import std/runtime
~import std/io
const std = @import("std");
~pub event set-config {
enabled: bool,
ratio: f64,
count: i64,
}
| ok {
enabled: bool,
ratio: f64,
count: i64,
}
~proc set-config|zig {
return .{ .ok = .{
.enabled = enabled,
.ratio = ratio,
.count = count,
} };
}
~std/runtime:register(scope: "config") {
set-config
}
const SOURCE = "~set_config(enabled: true, ratio: 3.5, count: 42)";
~std/runtime:parse.source(source: SOURCE, file_name: "typed_args.kz", allocator: std.heap.page_allocator)
| parsed p |> std/runtime:eval(ast: p, scope: "config")
| result _ |> std/io:print.ln("OK")
| event-denied e |> std/io:print.ln("DENIED: {{e:s}}")
| exhausted _ |> std/io:print.ln("EXHAUSTED")
| validation-error _ |> std/io:print.ln("VALIDATION ERROR")
| dispatch-error _ |> std/io:print.ln("DISPATCH ERROR")
| scope-not-found _ |> std/io:print.ln("SCOPE NOT FOUND")
| parse-error e |> std/io:print.ln("PARSE ERROR: {{e:s}}")
Actual
[EVAL] Starting execution of pre-parsed flow
[EVAL] Validation passed
DENIED: set_config
Test Configuration
MUST_RUN