✓
Passing Passing: the compiler rejects this program as expected.
Code
// Multi-arm resume: the `=>` construct must name one of the DECLARED arms.
// `tripled` is not in `ask`'s resume sum { halved, timeout }; without this
// wall the unknown arm sails through to a raw Zig error in the emitted union
// construction. The koru-level diagnostic lists the legal arms.
~import std/io
~pub tor 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 => tripled n
| done r |> std/io:print.ln("{{ r:d }}")
Actual compiler output
error[KORU021]: effect 'ask' has no resume arm 'tripled' (arms: halved, timeout)
--> tests/regression/400_RUNTIME_FEATURES/400_126_reject_unknown_resume_arm/input.kz:22:0
❌ Compiler coordination error: Incomplete branch coverage
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must fail at runtime with:
CONTAINS KORU021
CONTAINS has no resume arm 'tripled'Flows
flow ~request click a branch to expand · @labels scroll to their anchor
request (payload: 20)
Test Configuration
MUST_ERROR