✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: the store name mints `__KoruStoreT_<name>` in the emitted program —
// `evil(x)` reads the call tail into the name and produces
// `const __KoruStoreT_evil(x) = struct` — Zig dies inside generated code on
// a symbol the author never wrote. A store name is a single identifier.
import std/io
import std/store
std/store:new(evil(x), capacity: 4) { v: i64 }
std/store:new(ok_name, capacity: 4) { v: i64 }
std/store:insert(ok_name) { v: 1 }
std/io:print.ln("rows: {{ ok_name.len:d }}")
Actual compiler output
error[KORU161]: std/store:new(evil(x)): 'evil(x)' is not a store name — the name mints `__KoruStoreT_<name>` in the emitted program, so it is one identifier (letter or `_`, then letters/digits/`_`)
--> tests/regression/600_STDLIB/690_STORE/690_375_store_name_with_call_tail_refused/input.k:8:1Must succeed:
Compile and run without errors.
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (evil(x), capacity: 4, source: v: i64)
flow ~new click a branch to expand · @labels scroll to their anchor
new (ok_name, capacity: 4, source: v: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (ok_name, source: v: 1)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "rows: {{ ok_name.len:d }}")
Test Configuration
MUST_ERROR