✓
Passing This code compiles and runs correctly.
Code
// 698_012 — a `ref(Dog)` column refuses a handle minted by a store that
// does not hold Dog rows. `cats` rows carry `lives`, not Dog's `hp`, so a
// cats handle is a foreign home: the write traps at the insert, naming the
// column and its declared target — the deref-side brand trap (690_196)
// would only fire later, far from the fault.
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(cats, capacity: 8) { lives: i64 }
std/store:new(owners, capacity: 8) { Owner }
std/store:insert(cats) { lives: 9 }
| row c |> std/store:insert(owners) { dog: c }
Actual
thread 297443078 panic: std/store: 'owners.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)
???:?:?: 0x10304e373 in _output_emitted.main_module.__koru_home_owners_dog (???)
???:?:?: 0x10304dda7 in _output_emitted.main_module.__store_insert_owners_event.__koru_handler_impl (???)
???:?:?: 0x10304d897 in _output_emitted.main_module.flow0 (???)
???:?:?: 0x10304d74f in _output_emitted.main (???)
???:?:?: 0x10304d66b in _main (???)
???:?:?: 0x1816a3dff in ??? (???)
???:?:?: 0x0 in ??? (???)
Expected patterns
Each line is a regex that must match the program output.
'owners\.dog' 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: 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 (cats, capacity: 8, source: lives: i64)
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 (cats, source: lives: 9)
Test Configuration
MUST_RUN EXPECT_TRAP · exit 134