✓
Passing Passing: the compiler rejects this program as expected.
Code
// Glyph discipline (KORU102): `=>` CONSTRUCTS a branch, so it is illegal on an
// effect/event declared `-> T` (single payload, no branches). The resume value
// of `! ask []const u8 -> i32` is PRODUCED with `->`, not constructed with `=>`.
// Without this rejection, `=> 42` silently emits `return 42` — the exact
// glyph ambiguity Phase 2 closes. Twin of the positive 400_116/400_117.
~import std/io
~pub tor query { q: string }
! ask string -> i32
| done i32
~proc query|zig {
const a = ask(q);
return .{ .done = a };
}
~query(q: "x")
! ask _ => 42
| done r |> std/io:print.ln("{{ r:d }}")
Actual compiler output
error[KORU102]: `=>` constructs a branch, but 'ask' is declared `-> i32` (single payload, no branches) — use `->` to produce it
--> tests/regression/400_RUNTIME_FEATURES/400_122_reject_construct_glyph_on_resume_effect/input.kz:18:0
❌ Compiler coordination error: Validation failed (see errors above)
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must fail at runtime with:
CONTAINS KORU102
CONTAINS use `->` to produce itFlows
flow ~query click a branch to expand · @labels scroll to their anchor
query (q: "x")
Test Configuration
MUST_ERROR