✓
Passing This code compiles and runs correctly.
Code
// WALL: plural `! updated` binds the write contract — the written field's
// { old, new } images — never row fields. Destructuring a row field here
// confuses the lifecycle grammar (`inserted`/`removed` project ROW fields
// by pun; `updated` carries the DELTA) and must be rejected with a message
// that teaches the contract, at the koru level.
import std/io
import std/store
std/store:new(reserve) { pool: 0[i64] }
std/store:new(squad, capacity: 64) { hp: i64 }
! updated { hp } |> std/store:stored { reserve.pool: reserve.pool + hp }
std/store:insert(squad) { hp: 10 }
Output must match:
MUST_ERROR
BACKEND_COMPILE_ERROR
CONTAINS updated
CONTAINS old
CONTAINS newFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: reserve, source: pool: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: squad, capacity: 64, source: hp: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: squad, source: hp: 10)
Test Configuration
Expected Error:
std/store:new(squad): `! updated` binds the written field's images — destructure exactly { old, new } (row fields ride `inserted`/`removed`)