✓
Passing This code compiles and runs correctly.
Code
// A lifecycle interceptor that BINDS a row field but never uses it must be
// rejected — the same KORU100 discipline every other binding obeys (bind it
// or discard with `_`). Here `! inserted { hp }` names `hp`, but the body only
// maintains a count and never reads it; the honest form is `! inserted _`.
//
// This wall has to live in the store transform: flow_checker's KORU100 pass
// deliberately SKIPS `[transform]` invocations, and `std/store:new` is one, so
// the normal unused-binding check never sees these arms.
~import std/io
~import std/store
~std/store:new(stats) { count: 0[i64] }
~std/store:new(pool, capacity: 64) { hp: i64 }
! inserted { hp } |> std/store:stored { stats.count: stats.count + 1 }
~std/store:watch(stats)
! count c |> std/io:print.ln("count {{ c:d }}")
~std/store:insert(pool) { hp: 1 }
| row _ |> _
| full |> _
Backend must reject with:
CONTAINS inserted
CONTAINS hp
CONTAINS never uses
CONTAINS inserted _Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: stats, source: count: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: pool, capacity: 64, source: hp: i64)
flow ~watch click a branch to expand · @labels scroll to their anchor
watch (expr: stats)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: pool, source: hp: 1)
Test Configuration
Expected Error:
std/store:new(pool): `! inserted` binds 'hp' but never uses it — discard the payload (`! inserted _`), or use the field in the body