✓
Passing Passing: the compiler rejects this program as expected.
Code
// The sweep-boundary wall, zip side: a `! each` arm binding read inside
// a NESTED `std/store:query` sweep body cannot cross — the transplant
// sees the bind's arm payload as wildcard `*` and names it untypeable.
// The named refusal (KORU161 + the lift-through-typed-binding teaching
// text) is the wall a14324d59 minted for wildcard-arm binds. RESIDUAL,
// named for a ruling: a DESTRUCTURED bind (`! each { first, _ }`) on
// the same boundary refuses earlier and lies — KORU100 "unused
// binding" — because the use-tracker also cannot see into the sweep
// body; the bind's type IS in the arm's record decl, so whether it
// should cross is open.
import std/io
import std/store
import std/control
std/store:new(rows, capacity: 8) { v: i64 }
std/store:insert(rows) { v: 1 }
std/control:zip(a: 0..2, b: 10..12)
! each p |> std/store:query(rows)
! query r |> std/io:print.ln("{{ p.first:d }} on {{ r.v:d }}")
Actual compiler output
error[KORU161]: std/store:query(rows): the sweep body reads 'p', bound by the `! each` arm — the arm's payload is wildcard `*`, so the binding's type is not in the decl and the sweep boundary cannot name it. Lift the value through a typed binding first (a mid-pipe `: p`, or a tor returning the concrete type).
--> tests/regression/600_STDLIB/690_STORE/690_386_arm_bind_across_sweep_boundary/input.k:19:1Output must match:
1Error output must contain
the sweep body reads 'p', bound by the `! each` arm — the arm's payload is wildcard `*`, so the binding's type is not in the decl and the sweep boundary cannot name itFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (rows, capacity: 8, source: v: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (rows, source: v: 1)
flow ~zip click a branch to expand · @labels scroll to their anchor
zip (a: 0..2, b: 10..12)
Test Configuration
MUST_ERROR LANGUAGES: zig