✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: the REFUSAL of a column-less `std/indexes:store` declaration.
// `std/indexes:store(players)` names a store but no column — the discovery
// read that the same as "no declaration": no field, no machinery, no
// diagnostic, a dead claim the author believes is live. An index keys on
// ONE column of the store; a declaration that omits it is 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:store(players)
std/io:print.ln("unreachable")
Actual compiler output
error[KORU161]: std/indexes:store(players): the declaration names no column - an index keys on one column of the store: std/indexes:store(players, <col>)
--> tests/regression/600_STDLIB/690_STORE/690_329_index_decl_no_column_refuses/input.k:13:0Must fail at runtime:
Program must error when executed.
Error output must contain
names no columnFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (players, capacity: 8, source: key: i64)
flow ~store click a branch to expand · @labels scroll to their anchor
store (expr: players, source: <implicit_source>)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreachable")
Test Configuration
MUST_ERROR