✓
Passing Passing: the compiler rejects this program as expected.
Code
import std/io
import std/store
std/store:new(ui) { n: 0[i64] }
std/store:new(batch, capacity: 2) { p: i64 }
! discharge |> std/io:print.ln("teardown")
seed = std/store:insert(batch) { p: 1 }
|> std/store:query(batch)
! query b |> std/store:stored { ui.n: ui.n + b.p }
main = seed()
Actual compiler output
error[KORU161]: std/store:new(batch): `! discharge` applies only to a store with a column the store cannot discharge unattended - every owned column here has one, so they auto-discharge at teardown and the arm would never fire
--> tests/regression/600_STDLIB/690_STORE/690_096_refused_store_decl_does_not_cascade/input.k:5:0Must contain:
`! discharge` applies only to a store with a column the store cannot discharge unattendedFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (ui, source: n: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (batch, capacity: 2, source: p: i64)
subflow ~seed click a branch to expand · @labels scroll to their anchor
insert (batch, source: p: 1)
subflow ~main click a branch to expand · @labels scroll to their anchor
seed
Test Configuration
MUST_ERROR