✓
Passing Passing: the compiler rejects this program as expected.
Code
// SUBFLOW-IMPLEMENTED EFFECTS, record-fire wall (pure .k, no proc) — a
// record payload arm is fired with NAMED fields, never positionally.
// `token(1, n)` against `! token { kind: i64, val: i64 }` reads as punning
// and hides which value lands in which field; it must be rejected with a
// wall that spells the named form. (Identity payloads keep the bare single
// value — `pong(x)` — which cannot pun: there is no field name to pun on.)
import std/io
pub tor scan { n: i64 }
! token { kind: i64, val: i64 } -> i64
| done i64
scan = token(1, n): t => done t
scan(n: 41)
! token t -> t.kind + t.val
| done r |> std/io:print.ln("{{ r:d }}")
Actual compiler output
error[KORU030]: effect 'token' carries a record payload — fire it with named fields: token(kind: ..., val: ...)
--> tests/regression/400_RUNTIME_FEATURES/400_140_effect_record_fire_requires_named_fields/input.k:13:0
error[KORU030]: effect 'token' carries a record payload — fire it with named fields: token(kind: ..., val: ...)
--> tests/regression/400_RUNTIME_FEATURES/400_140_effect_record_fire_requires_named_fields/input.k:13:0
error[KORU022]: effect 'token' payload field 'kind' missing at the firing site (token(kind: ..., val: ...))
--> tests/regression/400_RUNTIME_FEATURES/400_140_effect_record_fire_requires_named_fields/input.k:13:0
error[KORU022]: effect 'token' payload field 'val' missing at the firing site (token(kind: ..., val: ...))
--> tests/regression/400_RUNTIME_FEATURES/400_140_effect_record_fire_requires_named_fields/input.k:13:0
❌ Compiler coordination error: Validation failed (see errors above)
(set KORU_BACKEND_TRACE=1 for the backend return trace)Backend must reject with:
CONTAINS error[KORU030]
CONTAINS fire it with named fieldsFlows
subflow ~scan click a branch to expand · @labels scroll to their anchor
token (1, n)
flow ~scan click a branch to expand · @labels scroll to their anchor
scan (n: 41)
Test Configuration
MUST_ERROR