⚠
Broken The test itself needs fixing.
Sibling-field union (`player: Player, enemy: Enemy` in the store seed) is not the store surface. The signed declaration was `entity: Player | Enemy`. These pins must not stay green in stdlib.
Failure Output
error[KORU161]: std/store:query(arena): the guard reads `e is ...`, but no insert names `kind:` - there is no tag to read; tag the inserts (`insert(arena, kind: player) { ... }`) first
--> tests/regression/600_STDLIB/690_STORE/690_280_is_sugar_kindless_store_refused/input.k:20:0 Code
// `is` on a kindless store refuses loudly: no insert names `kind:`, so
// there is no tag to read. Tag the inserts first.
import std/proto
import std/store
std/proto:f64(Health)
std/proto(Player) {
health: Health
}
std/proto(Enemy) {
health: Health
}
std/store:new(arena, capacity: 8) { player: Player, enemy: Enemy }
std/store:insert(arena) { health: 98.6 }
std/store:query(arena)
! query e when e is enemy |> std/store:stored { e.health: 0.0 }
Actual compiler output
error[KORU161]: std/store:query(arena): the guard reads `e is ...`, but no insert names `kind:` - there is no tag to read; tag the inserts (`insert(arena, kind: player) { ... }`) first
--> tests/regression/600_STDLIB/690_STORE/690_280_is_sugar_kindless_store_refused/input.k:20:0Compiler must reject:
Compilation must fail with a diagnostic.
Flows
flow ~f64 click a branch to expand · @labels scroll to their anchor
f64 (expr: Health)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Player, source: health: Health)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Enemy, source: health: Health)
flow ~new click a branch to expand · @labels scroll to their anchor
new (arena, capacity: 8, source: player: Player, enemy: Enemy)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (arena, source: health: 98.6)
flow ~query click a branch to expand · @labels scroll to their anchor
query (arena)
Test Configuration
MUST_ERROR