✗
Failing This test is currently failing.
Failed: frontend
Failure Output
error[PARSE003]: Zig-style struct syntax '.{' is not valid in Koru parameter values — pass fields as named parameters instead
--> tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_038_union_param_callsite_gap/input.kz:24:1
|
24 | ~describe(v: .{ .text = "hello" }): d |> std/io:print.ln("{{ d:s }}")
| ^ Code
// Pins the union-parameter call-site gap: an event whose parameter is a host
// union type has no Koru-level way to receive a value. Zig union-literal
// syntax in an arg is PARSE003-walled (correctly — host syntax stays out of
// Koru), but no Koru construction form exists in its place, so any API built
// on union parameters (std/json's builder is the live instance) is
// unreachable from pure Koru call sites.
const std = @import("std");
~import std/io
const Value = union(enum) {
text: []const u8,
number: i64,
};
~pub event describe { v: Value } -> string
~proc describe|zig {
return switch (v) {
.text => "got text",
.number => "got number",
};
}
~describe(v: .{ .text = "hello" }): d |> std/io:print.ln("{{ d:s }}")
Expected output
got text
Test Configuration
MUST_RUN