✓
Passing Passing: the compiler rejects this program as expected.
Code
// SUBFLOW-IMPLEMENTED EFFECTS, the ownership wall (pure .k, no proc) — only
// the declaring event's own implementation may fire its arms. Here a SECOND
// event's impl calls `pong`, which is ping's effect arm, not an event. That
// must be rejected — and with a GUIDING diagnostic naming the owner, not a
// bare "unknown event": firing from outside the impl is an understandable
// mistake, and the wall should point at the rule that was broken.
import std/io
pub tor ping { x: i64 }
! pong i64
ping = pong(x)
pub tor other { x: i64 }
! stray i64
other = pong(x)
ping(x: 41)
! pong reply |> std/io:print.ln("{{ reply + 1:d }}")
Actual compiler output
error[KORU040]: 'pong' is an effect arm of tor 'input:ping' — only that tor's own implementation may fire it
--> tests/regression/400_RUNTIME_FEATURES/400_138_effect_arm_call_outside_impl_rejected/input.k:17:0
❌ Compiler coordination error: Unknown tor referenced
(set KORU_BACKEND_TRACE=1 for the backend return trace)Backend must reject with:
CONTAINS error[KORU040]
CONTAINS only that tor's own implementation may fire itFlows
subflow ~ping click a branch to expand · @labels scroll to their anchor
pong (x)
subflow ~other click a branch to expand · @labels scroll to their anchor
pong (x)
flow ~ping click a branch to expand · @labels scroll to their anchor
ping (x: 41)
Test Configuration
MUST_ERROR