066 store query nested in loop

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

Code

input.k

Actual compiler output

error[KORU161]: std/store:rule(items) is top-level-only: it cannot be nested inside a handler or loop body. `query` is a standing-rule installation (comptime-fused into the store's write paths), so a nested body has nothing to install into. The store IS declared - move the query to module (top-level) scope. Momentary verbs (insert/take) DO run in nested bodies.
  --> tests/regression/600_STDLIB/690_STORE/690_066_store_query_nested_in_loop/input.k:29:0

Compiler must reject:

Compilation must fail with a diagnostic.

Flows

flow ~new click a branch to expand · @labels scroll to their anchor
new (items, capacity: 8, source: v: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (items, source: v: 10)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (items, source: v: 20)
flow ~for click a branch to expand · @labels scroll to their anchor
for (0..2)

Test Configuration

MUST_ERROR