✓
Passing Passing: the compiler rejects this program as expected.
Code
// 695_011 — `order:` on a flat `query` site is refused, not dropped. A plain
// sweep has no levels to order; the diagnostic points at preorder rather than
// silently emitting an unordered walk.
import std/io
import std/store
std/store:new(pool, capacity: 64) { hp: i64 }
std/store:insert(pool) { hp: 5 }
std/store:query(pool, order: "hp")
! query e |> std/io:print.ln("{{ e.hp:d }}")
Actual compiler output
error[KORU161]: std/store:query(pool): `order:` is a preorder clause - a query sweep has no levels to order (declare the store [tree] and walk std/store:preorder)
--> tests/regression/600_STDLIB/695_STORE_TREE/695_011_order_on_query_refused/input.k:11:0Must contain:
`order:` is a preorder clauseFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (pool, capacity: 64, source: hp: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (pool, source: hp: 5)
flow ~query click a branch to expand · @labels scroll to their anchor
query (pool, order: "hp")
Test Configuration
MUST_ERROR