✓
Passing Passing: the compiler rejects this program as expected.
Code
// MUST_ERROR — presence-testing a REQUIRED arm. Designed 2026-07-03: the
// presence expression (`if(pong)` / `when pong`) exists because OPTIONAL
// handlers may be absent. A required arm is always installed — the
// exhaustiveness check guarantees it — so testing for it is a meaningless
// always-true and almost certainly a misread of the contract. Reject it
// and say why, rather than folding to `true` silently.
import std/io
pub tor ping { x: i64 }
! pong i64
ping = if(pong)
| then |> pong(x)
| else |> pong(0)
ping(x: 41)
! pong v |> std/io:print.ln("{{ v:d }}")
Actual compiler output
error[KORU131]: presence test on 'pong' — a required arm is always installed (exhaustiveness guarantees a handler), so `if(pong)` is always true; presence tests are for `?` optional arms
--> tests/regression/400_RUNTIME_FEATURES/400_150_effect_required_arm_presence_test_rejected/input.k:12:0
❌ Compiler coordination error: Incomplete branch coverage
(set KORU_BACKEND_TRACE=1 for the backend return trace)Backend must reject with:
CONTAINS 'pong'
CONTAINS always installedFlows
subflow ~ping click a branch to expand · @labels scroll to their anchor
if (pong)
flow ~ping click a branch to expand · @labels scroll to their anchor
ping (x: 41)
Test Configuration
MUST_ERROR