✓
Passing This code compiles and runs correctly.
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 event query { q: []const u8 }
! ask []const u8 -> 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 }}")
Must fail at runtime with:
CONTAINS KORU102
CONTAINS use `->` to produce itError Verification
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:19:0
❌ Compiler coordination error: Validation failed (see errors above)
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/400_122_reject_construct_glyph_on_resume_effect/backend.zig:94:13: 0x1007231c7 in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/400_122_reject_construct_glyph_on_resume_effect/backend.zig:190:28: 0x100723eb3 in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^Flows
flow ~query click a branch to expand · @labels scroll to their anchor
query (q: "x")
Test Configuration
MUST_FAIL