✓
Passing This code compiles and runs correctly.
Code
// Glyph discipline, produce side (dual of 400_122): `->` produces the single
// anonymous resume value. When the effect declares named resume ARMS, there is
// no anonymous value to produce — the handler must SELECT an arm with `=>`.
// Without this wall, `-> n` would emit a bare value where the synthesized
// resume union is expected and die as a raw Zig type error.
~import std/io
~pub event request { payload: i32 }
! ask i32
| halved i32
| timeout
| done i32
~proc request|zig {
const r = ask(payload);
return switch (r) {
.halved => |v| .{ .done = v },
.timeout => .{ .done = -1 },
};
}
~request(payload: 20)
! ask n -> n
| done r |> std/io:print.ln("{{ r:d }}")
Must fail at runtime with:
CONTAINS KORU102
CONTAINS construct one with `=>`Error Verification
Actual Compiler Output
error[KORU102]: `->` produces a single resume value, but 'ask' declares named resume arms — construct one with `=>` (e.g. `=> halved ...`)
--> tests/regression/400_RUNTIME_FEATURES/400_125_reject_produce_glyph_on_multi_arm_effect/input.kz:24:0
❌ Compiler coordination error: Validation failed (see errors above)
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/400_125_reject_produce_glyph_on_multi_arm_effect/backend.zig:95:13: 0x100d4b9d3 in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/400_125_reject_produce_glyph_on_multi_arm_effect/backend.zig:202:28: 0x100d4cb63 in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^Flows
flow ~request click a branch to expand · @labels scroll to their anchor
request (payload: 20)
Test Configuration
MUST_FAIL