✓
Passing This code compiles and runs correctly.
Code
// A lone store PACKS. Two placements of one proto are two subgraphs, not
// a union and not a fold: `left: Limb` and `right: Limb` mint two Health
// cells whose names are the DAG paths (`left.health`, `right.health`).
// Query `e.left.health` is one packed leaf, not a pointer walk. Folding
// same path+type across stores is a store-set act — not this file.
import std/io
import std/proto
import std/store
std/proto:i64(Health)
std/proto(Limb) {
health: Health
}
std/store:new(body, capacity: 8) { left: Limb, right: Limb }
std/store:insert(body) { left.health: 10, right.health: 20 }
std/store:query(body)
! query e |> std/io:print.ln("left {{ e.left.health:d }}")
std/store:query(body)
! query e |> std/io:print.ln("right {{ e.right.health:d }}")
Actual
left 10
right 20
Expected output
left 10
right 20
Flows
flow ~i64 click a branch to expand · @labels scroll to their anchor
i64 (expr: Health)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Limb, source: health: Health)
flow ~new click a branch to expand · @labels scroll to their anchor
new (body, capacity: 8, source: left: Limb, right: Limb)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (body, source: left.health: 10, right.health: 20)
flow ~query click a branch to expand · @labels scroll to their anchor
query (body)
flow ~query click a branch to expand · @labels scroll to their anchor
query (body)
Test Configuration
MUST_RUN