328 index second decl refuses

✓ Passing Passing: the compiler rejects this program as expected.

Code

input.k

Actual compiler output

error[KORU161]: std/indexes:store(players, val): 'players' already carries an index on 'key' - a second index on one store is a later rung
  --> tests/regression/600_STDLIB/690_STORE/690_328_index_second_decl_refuses/input.k:17:0

Must fail at runtime:

Program must error when executed.

Error output must contain

already carries an index

Flows

flow ~new click a branch to expand · @labels scroll to their anchor
new (players, capacity: 8, source: key: i64, val: i64)
flow ~store click a branch to expand · @labels scroll to their anchor
store (expr: players, key, source: <implicit_source>)
flow ~store click a branch to expand · @labels scroll to their anchor
store (expr: players, val, source: <implicit_source>)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreachable")

Test Configuration

MUST_ERROR