✓
Passing This code compiles and runs correctly.
Code
// PINS: a list carrying ref(T) enforces the same home contract a store
// column does — the proto declares the kind, the program's pluralities
// determine the home set, and the consumer enforces at its own write
// boundary. `dog: 3` is no minted handle: its brand byte names no home,
// so the push traps — the carrier-side twin of 698_012's insert refusal.
import std/proto
import std/store
import std/list
std/proto(Dog) {
hp: i64
}
std/proto(Owner) {
name: string
dog: ref(Dog)
}
std/store:new(dogs, capacity: 8) { Dog }
std/store:insert(dogs) { hp: 7 }
| row d |> std/list:new(Owner)
| list xs |> std/list:push(xs, name: "a", dog: 3) |> std/list:free(xs)
| err e |> _
Actual
thread 297450509 panic: std/list: 'List_Owner.dog' is ref(Dog) - the value is not a handle a Dog-holding store minted (`| row` on such a store's insert or cursor; -1 is the unset sentinel)
???:?:?: 0x102fc6ae3 in _output_emitted.main_module.__koru_home_List_Owner_dog (???)
???:?:?: 0x102fc60a7 in _output_emitted.main_module.push_Owner_event.handler (???)
???:?:?: 0x102fc593b in _output_emitted.main_module.flow0 (???)
???:?:?: 0x102fc574f in _output_emitted.main (???)
???:?:?: 0x102fc566b in _main (???)
???:?:?: 0x1816a3dff in ??? (???)
???:?:?: 0x0 in ??? (???)
Expected patterns
Each line is a regex that must match the program output.
is ref\(Dog\)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: name: string
dog: ref(Dog))
flow ~new click a branch to expand · @labels scroll to their anchor
new (dogs, capacity: 8, source: Dog)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (dogs, source: hp: 7)
Test Configuration
MUST_RUN EXPECT_TRAP · exit 134