✓
Passing Passing: the compiler rejects this program as expected.
Code
// MUST_ERROR — firing a value-resuming OPTIONAL arm WITHOUT a presence test.
// Designed 2026-07-03: `! ?ask i64 -> i64` may be omitted by the consumer,
// so an UNGUARDED fire binds a value that might not exist. No no-op can be
// synthesized (a fn with a mandatory return and an empty body is not a
// thing), and a fabricated default would be a silent fallback. The wall:
// the fire must be dominated by a presence test (`if(ask)` / `when ask`,
// 400_146/147), and the diagnostic points there — pit-of-success.
//
// Pinned failure BEFORE the wall existed: this exact program sailed through
// analysis and died at Stage D with a raw Zig leak ("function with non-void
// return type 'i64' implicitly returns" on the synthesized no-op).
import std/io
pub tor query { q: i64 }
! ?ask i64 -> i64
| done i64
query = ask(q): a => done a
query(q: 41)
| done r |> std/io:print.ln("{{ r:d }}")
Actual compiler output
error[KORU130]: effect 'ask' is optional and resumes a value — a consumer may omit the handler, so the fire must sit under a presence test: if(ask) | then |> ask(...): ... | else |> <your fallback>
--> tests/regression/400_RUNTIME_FEATURES/400_149_effect_optional_resume_unguarded_fire/input.k:18:0
❌ Compiler coordination error: Validation failed (see errors above)
(set KORU_BACKEND_TRACE=1 for the backend return trace)Backend must reject with:
CONTAINS 'ask' is optional
CONTAINS if(ask)Flows
subflow ~query click a branch to expand · @labels scroll to their anchor
ask (q)
flow ~query click a branch to expand · @labels scroll to their anchor
query (q: 41)
Test Configuration
MUST_ERROR