✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: the REFUSAL of an `std/indexes` declaration on a capacity-1 VALUE
// store. The index machinery lives on the plural container's emit path —
// on a value store the declaration can never produce machinery and its only
// readers (query/first) refuse on the tier anyway (690_354). A dead claim
// the author believes is live — refused at the declaration's own location.
import std/store
import std/indexes
import std/io
std/store:new(game) { entities: 0[i64] }
std/indexes:store(game, entities)
std/io:print.ln("unreachable")
Actual compiler output
error[KORU161]: std/indexes:store(game, entities): 'game' is a capacity-1 value store — an index keys a plural container's rows; declare `std/store:new(game, capacity: N)` or drop the index
--> tests/regression/600_STDLIB/690_STORE/690_380_index_on_value_store_refused/input.k:11:1Must fail at runtime with:
ERROR_AT 11Error output must contain
capacity-1 value storeFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (game, source: entities: 0[i64])
flow ~store click a branch to expand · @labels scroll to their anchor
store (expr: game, entities, source: <implicit_source>)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreachable")
Test Configuration
MUST_ERROR LANGUAGES: zig