✓
Passing Passing: the compiler rejects this program as expected.
Code
// std/rings — a phantom-typed element value is refused at the declaration:
// `Src<live!>` carries custody that a slot can't hold this rung. Twin of
// 320_109 (borrow element); the obligation-transit rung (699_022 family)
// decides whether this refusal relaxes into consume/mint semantics or stays
// a wall by design.
import std/proto
import std/rings
std/proto(Src) {
id: i64
}
std/rings:new(feed, capacity: 8) { value: Src<live!> }
Actual compiler output
error[KORU161]: std/rings:new(feed): a ring carries plain values — 'Src<live!>' is a borrow, array, or phantom-typed element, and none of those have a slot shape this rung
--> tests/regression/300_ADVANCED_FEATURES/320_STDLIB/320_171_rings_phantom_element_refused/input.k:13:0Compiler must reject:
Compilation must fail with a diagnostic.
Flows
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Src, source: id: i64)
flow ~new click a branch to expand · @labels scroll to their anchor
new (feed, capacity: 8, source: value: Src<live!>)
Test Configuration
MUST_ERROR