✓
Passing Passing: the compiler rejects this program as expected.
Code
// A wildcard-payload arm binding (`! as g` on capture — the arm's payload
// is `*`) cannot be typed by lookupBranch, so it cannot cross a store
// sweep boundary. Before the bind was collected at all, a body that read
// it dropped through and the emitted Zig died `use of undeclared
// identifier` — the pin holds the named refusal that replaced the hole.
import std/io
import std/store
std/store:new(spec, capacity: 8) { d: i64 }
std/store:insert(spec) { d: 10 }
capture { items: [_]i64{ 10, 20 } }
! as g |> std/store:query(spec)
! query s
|> std/io:print.ln("{{ g.items:s }}")
Actual compiler output
error[KORU161]: std/store:query(spec): the sweep body reads 'g', bound by the `! as` 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 `: g`, or a tor returning the concrete type).
--> tests/regression/600_STDLIB/690_STORE/690_383_wildcard_arm_bind_refuses_at_sweep/input.k:13:1Must fail at runtime with:
ERROR_AT 13Error output must contain
arm's payload is wildcardFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (spec, capacity: 8, source: d: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (spec, source: d: 10)
flow ~capture click a branch to expand · @labels scroll to their anchor
capture (source: items: [_]i64{ 10, 20 })
Test Configuration
MUST_ERROR LANGUAGES: zig