✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: keyed addressing `store[key: value]` refuses at every consumer that
// would otherwise splice the bracket interior verbatim into
// `__koru_resolve(...)`, emitting invalid host code. The `key:` decl emits
// no lookup machinery today (690_018) — a consumer must honor or refuse,
// and refusal names the pin and the working spelling (store[handle]).
import std/io
import std/store
std/store:new(pool, key: id, capacity: 64) { id: i64, hp: i64 }
std/store:insert(pool) { id: 7, hp: 50 }
std/store:query(pool)
! query e |> std/store:stored { pool[id: 7].hp: e.hp - 10 }
Actual compiler output
error[KORU161]: std/store:stored: keyed addressing 'pool[id: 7].hp' is a pinned hole (690_018) - no key->row map is emitted; address the row by handle instead (store[handle])
--> tests/regression/600_STDLIB/690_STORE/690_349_store_keyed_addressing_refused/input.k:13:0Must fail at runtime with:
CONTAINS error[KORU161]
CONTAINS keyed addressing
CONTAINS 690_018Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (pool, key: id, capacity: 64, source: id: i64, hp: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (pool, source: id: 7, hp: 50)
flow ~query click a branch to expand · @labels scroll to their anchor
query (pool)
Test Configuration
MUST_ERROR