✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: the REFUSAL of a multi-field stored envelope spanning TWO stores —
// the envelope is one atomic unit against one store ((i) chain-envelope,
// 690_009), and an entry addressing a second store is refused with BOTH
// stores named, not silently split into two units. The legal spelling is a
// chained pair of stored statements (690_190/690_194 lean on it for the
// per-row f64 counter this program is the collapsed form of).
import std/io
import std/store
std/store:new(cells, capacity: 2) { x: f64 }
std/store:new(acc) { t: 0.0[f64] }
std/store:insert(cells) { x: 1.0 }
std/store:query(cells)
! query e |> std/store:stored { e.x: acc.t, acc.t: acc.t + 0.5 }
Actual compiler output
error[KORU161]: std/store:stored: a multi-field envelope writes ONE store this rung ('cells' vs 'acc')
--> tests/regression/600_STDLIB/690_STORE/690_193_stored_envelope_refuses_two_stores/input.k:15:0Must contain:
a multi-field envelope writes ONE store this rungFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (cells, capacity: 2, source: x: f64)
flow ~new click a branch to expand · @labels scroll to their anchor
new (acc, source: t: 0.0[f64])
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (cells, source: x: 1.0)
flow ~query click a branch to expand · @labels scroll to their anchor
query (cells)
Test Configuration
MUST_ERROR