✓
Passing Passing: the compiler rejects this program as expected.
Code
// The guard side of the undeclared-branch direction: WITHOUT `[prototype]`,
// handling a branch the event does not declare is a hard KORU021 error. This
// is byte-for-byte the source of 400_165 with the annotation removed: there
// the `| soon` arm is tolerated and pruned; here it must be rejected.
//
// This pins that declaration-debt cannot leak into ordinary code: the
// handled-but-undeclared arm slides ONLY under the greppable in-source
// annotation, never by default.
import std/io
pub tor run {}
| done
| err string
run => err "declared path ran"
run()
| done |> std/io:print.ln("done ran")
| err msg |> std/io:print.ln(msg)
| soon |> std/io:print.ln("undeclared arm — must be KORU021 without [prototype]")
Actual compiler output
error[KORU021]: event 'input:run' has no branch 'soon' (available: done, err)
--> tests/regression/400_RUNTIME_FEATURES/400_166_undeclared_branch_rejected_without_annotation/input.k:21:0
❌ Compiler coordination error: Incomplete branch coverage
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must fail at runtime:
Program must error when executed.
Error output must contain
KORU021Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_ERROR