✓
Passing This code compiles and runs correctly.
Code
// 698_015 — `-1` is the store's standing unset sentinel (tree `parent`
// defaults to it): a `ref(Dog)` column accepts it as "no reference" —
// the home check gates handles, not the absence of one.
import std/proto
import std/store
import std/io
std/proto(Dog) {
hp: i64
}
std/proto(Owner) {
dog: ref(Dog)
}
std/store:new(dogs, capacity: 8) { Dog }
std/store:new(owners, capacity: 8) { Owner }
std/store:insert(owners) { dog: -1 }
std/store:query(owners)
! query o |> std/io:print.ln("dog {{ o.dog:d }}")
Actual
dog -1
Expected output
dog -1
Flows
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Dog, source: hp: i64)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Owner, source: dog: ref(Dog))
flow ~new click a branch to expand · @labels scroll to their anchor
new (dogs, capacity: 8, source: Dog)
flow ~new click a branch to expand · @labels scroll to their anchor
new (owners, capacity: 8, source: Owner)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (owners, source: dog: -1)
flow ~query click a branch to expand · @labels scroll to their anchor
query (owners)
Test Configuration
MUST_RUN