✓
Passing This code compiles and runs correctly.
Code
// Pins the load-bearing store guarantee: two stores mint DISTINCT row types
// at the FLOW level — the generics-by-specialization mechanism. `pool` rows
// are __KoruStoreRow_pool, `bank` rows are __KoruStoreRow_bank; each take's
// `| item` binding carries its OWN store's shape, routed to its OWN take unit
// (__store_take_pool vs __store_take_bank). A single conflated item type/unit
// could not keep the two stores' per-item field access correct at once.
//
// A BARE store (no `[entity(...)]`) mints no obligation, so `take` is just
// remove-with-value — no discharge needed. Field-EXISTENCE checking on a store
// row (e.g. `i.gold` on a pool item) is a SEPARATE rung, left to the Zig
// backend for now. This test pins TYPE DISTINCTNESS, not field diagnostics.
import std/io
import std/store
std/store:new(pool) { hp: i64 }
std/store:new(bank) { gold: i64 }
std/store:insert(pool) { hp: 9 }
| row r |> std/store:take(pool[r])
| item i |> std/io:print.ln("pool hp {{ i.hp:d }}")
std/store:insert(bank) { gold: 50 }
| row r |> std/store:take(bank[r])
| item j |> std/io:print.ln("bank gold {{ j.gold:d }}")
Actual
pool hp 9
bank gold 50
Expected output
pool hp 9
bank gold 50
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: pool, source: hp: i64)
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: bank, source: gold: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: pool, source: hp: 9)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: bank, source: gold: 50)
Test Configuration
MUST_RUN