✓
Passing Passing: the compiler rejects this program as expected.
Code
// Glyph discipline, the SWEPT-ARM case — sibling of 400_199 (`=>` on a void
// effect under a real handler). A `=>` inside a `! query` arm body can never
// construct: the body grafts into a synthesized VOID per-row unit, so the
// enclosing tor's branch cannot be produced from in there. Without this wall
// the construct survives checking — the grafted body is marked
// is_transformed_subtree, which checkers skip — and dies in emitted Zig
// ("type 'void' does not support struct initialization syntax" inside the
// synthesized sweepbody). The wall lives in the query transform, pre-graft,
// where the user body is still visible.
// Pure-.k realization of kopium wired/holes/10's remaining gap.
import std/io
import std/store
std/store:new(box, capacity: 4) { n: i64 }
tor work {}
| ran
| rejected
work = std/store:query(box)
! query e |> std/io:print.ln("row {{ e.n:d }}") => ran
std/store:insert(box) { n: 1 }
| row _ |> work()
| ran |> std/io:print.ln("RAN")
| rejected |> std/io:print.ln("REJ")
| full |> std/io:print.ln("FULL")
Actual compiler output
error[KORU102]: std/store:query(box): `=>` inside a `! query` arm has nothing to construct — the arm body grafts into a void synthesized unit, so a branch of the enclosing tor cannot be produced from in there. Hand the verdict out through the enclosing surface and branch after it returns.
--> tests/regression/600_STDLIB/690_STORE/690_357_construct_glyph_in_query_arm/input.k:21:0Compiler must reject:
Compilation must fail with a diagnostic.
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (box, capacity: 4, source: n: i64)
subflow ~work click a branch to expand · @labels scroll to their anchor
query (box)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (box, source: n: 1)
Test Configuration
MUST_ERROR