✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test: `std/fleet:spawn(f, id:, cell: nosuch)` — the shape name must resolve
// to a declared std/proto at comptime. An unknown shape is a refusal, not a
// runtime miss — same contract as `std/cell:open`.
~import std/io
~import std/fleet
~import std/proto
~import std/runtime
~std/proto(room_state) {
visits: u32
}
~std/runtime:register(scope: "cell") {
}
~std/fleet:new(node, scope: "cell", world: "", capacity: 8)
~std/fleet(node)
| fleet f |> std/fleet:spawn(f, id: "room-9", cell: nosuch)
| spawned b |> std/io:print.ln("spawned")
| resident |> std/io:print.ln("resident")
| refused |> std/io:print.ln("refused")
Actual compiler output
[REGISTRY] Creating dispatcher for scope 'cell'
[REGISTRY] Found 0 events
[REGISTRY] Generated 9792 bytes
error[KORU161]: std/fleet:spawn: unknown shape 'nosuch' — no `std/proto(nosuch) { ... }` declared
--> tests/regression/400_RUNTIME_FEATURES/450_FLEET/450_004_spawn_unknown_shape/input.kz:20:0Must fail at runtime with:
CONTAINS unknown shape
CONTAINS std/proto(nosuch)Flows
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 ~new click a branch to expand · @labels scroll to their anchor
new (expr: node, scope: "cell", world: "", capacity: 8)
flow ~std/fleet click a branch to expand · @labels scroll to their anchor
std/fleet (node)
Test Configuration
MUST_ERROR