✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: the REFUSAL of an `std/indexes` declaration naming a store that is
// never declared. The declaration is AST-data discovered by the named
// store's `new` emit — a name nothing claims goes silently dead: no field,
// no machinery, no diagnostic, and the author believes `ghost` is indexed.
// Same dead-claim family as the second-declaration wall (690_328) and the
// column-less wall (690_329) — refused at the declaration's own location.
import std/store
import std/indexes
import std/io
std/store:new(players, capacity: 8) { key: i64 }
std/indexes:ordered(ghost, key)
std/store:insert(players) { key: 1 }
|> std/io:print.ln("unreachable")
Actual compiler output
error[KORU161]: std/indexes:ordered(ghost, key): 'ghost' is not a declared store — an index keys one container's rows; declare `std/store:new(ghost, capacity: N)` first or fix the name
--> tests/regression/600_STDLIB/690_STORE/690_379_index_decl_names_no_store_refused/input.k:12:1
error[KORU161]: std/store:insert: unknown store 'players' - no std/store:new(players) found
--> tests/regression/600_STDLIB/690_STORE/690_379_index_decl_names_no_store_refused/input.k:14:1Must fail at runtime with:
ERROR_AT 12Error output must contain
is not a declared storeFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (players, capacity: 8, source: key: i64)
flow ~ordered click a branch to expand · @labels scroll to their anchor
ordered (expr: ghost, key, source: <implicit_source>)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (players, source: key: 1)
Test Configuration
MUST_ERROR LANGUAGES: zig