✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: the REFUSAL of a second `std/store:new` on a name the same module
// already declared. The name mints `__KoruStoreT_<name>` / `__koru_store_<name>`
// at one emitted scope — a second `new` re-mints the same Zig symbols and the
// program dies in the backend on "duplicate struct member" errors the author
// never wrote. The LATER declaration is the offender (the same ruling the
// second-index-decl wall carries, 690_328), so the refusal points at its line.
import std/store
import std/io
std/store:new(players, capacity: 8) { key: i64 }
std/store:new(players, capacity: 8) { key: i64, other: i64 }
std/store:insert(players) { key: 1, other: 2 }
|> std/io:print.ln("unreachable")
Actual compiler output
error[KORU161]: std/store:new(players): 'players' is already declared — a second `new` on one store name re-mints `__KoruStoreT_players` and `__koru_store_players`; rename it or drop the earlier declaration
--> tests/regression/600_STDLIB/690_STORE/690_381_second_store_new_refused/input.k:11:1
error[KORU161]: std/store:insert(players): a row block names every column exactly once (2 given, 1 declared)
--> tests/regression/600_STDLIB/690_STORE/690_381_second_store_new_refused/input.k:13:1Must fail at runtime with:
ERROR_AT 11Error output must contain
already declaredFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (players, capacity: 8, source: key: i64)
flow ~new click a branch to expand · @labels scroll to their anchor
new (players, capacity: 8, source: key: i64, other: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (players, source: key: 1, other: 2)
Test Configuration
MUST_ERROR LANGUAGES: zig