✓
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) { 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 _Error Verification
Actual Compiler Output
🎯 Compiler coordination: Passes: 17 (flow-based: frontend, analysis, emission)
Error: output_emitted.zig:39:16: error: std/store:new(pool): `! inserted` binds 'hp' but never uses it — discard the payload (`! inserted _`), or use the field in the body
comptime { @compileError("std/store:new(pool): `! inserted` binds 'hp' but never uses it — discard the payload (`! inserted _`), or use the field in the body"); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
main_module: output_emitted.zig:29:25
main: output_emitted.zig:919:5
4 reference(s) hidden; use '-freference-trace=6' to see all references
output_emitted.zig:41:16: error: std/store:insert: unknown store 'pool' - no std/store:new(pool) found
comptime { @compileError("std/store:insert: unknown store 'pool' - no std/store:new(pool) found"); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~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, 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
MUST_FAIL
Expected Error:
std/store:new(pool): `! inserted` binds 'hp' but never uses it — discard the payload (`! inserted _`), or use the field in the body