✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test: `std/cell:capture` without `! as` — the live record is the capture's
// whole point; a capture that never binds it is a refusal at transform time.
~import std/io
~import std/cell
~import std/proto
~import std/runtime
~std/proto(room_state) {
visits: u32
}
~std/runtime:register(scope: "cell") {
}
~std/cell:open(room_state, id: "room-7")
| cell c |> std/cell:capture(c, shape: room_state)
| captured f |> std/io:print.ln("{{ f.visits:d }}")
|> std/cell:hibernate(c)
Actual compiler output
[REGISTRY] Creating dispatcher for scope 'cell'
[REGISTRY] Found 0 events
[REGISTRY] Generated 9792 bytes
error[KORU161]: std/cell:capture(room_state) requires a `! as <record>` effect branch — `! as s |> ...`
--> tests/regression/400_RUNTIME_FEATURES/460_CELL/460_007_cell_capture_requires_as_arm/input.kz:17:0Must fail at runtime with:
CONTAINS requires a `! as <record>` effect branchFlows
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (room_state, source: visits: u32)
flow ~register click a branch to expand · @labels scroll to their anchor
register (scope: "cell", source: )
flow ~open click a branch to expand · @labels scroll to their anchor
open (expr: room_state, id: "room-7")
Test Configuration
MUST_ERROR