?
Unknown Status unknown.
Code
// Test: Identity branches with phantom types in runtime dispatcher
// The runtime dispatcher must handle identity branches (bare types, not structs)
~import std/runtime
~import std/io
// Identity branch with phantom annotation
~pub tor create {}
| handle []const u8<active!>
~create => handle "resource_1"
// Discharge event
~pub tor destroy { h: string<!active> }
~proc destroy|zig {
std.debug.print("destroyed: {s}\n", .{h});
}
const std = @import("std");
~std/runtime:register(scope: "test") {
create(10)
destroy(1)
}
const TEST_SOURCE = "create()\n| handle h |> result { id: h }";
~std/runtime:run(source: TEST_SOURCE, scope: "test", budget: 100)
| result _ |> std/io:print.ln("PASS: got handle")
| exhausted _ |> std/io:print.ln("FAIL: exhausted")
| parse-error _ |> std/io:print.ln("FAIL: parse_error")
| validation-error _ |> std/io:print.ln("FAIL: validation_error")
| shape-error _ |> std/io:print.ln("FAIL: shape_error")
| event-denied _ |> std/io:print.ln("FAIL: event_denied")
| dispatch-error _ |> std/io:print.ln("FAIL: dispatch_error")
| scope-not-found _ |> std/io:print.ln("FAIL: scope_not_found")
Flows
flow ~register click a branch to expand · @labels scroll to their anchor
register (scope: "test", source: create(10)
destroy(1))
flow ~run click a branch to expand · @labels scroll to their anchor
run (source: TEST_SOURCE, scope: "test", budget: 100)
Test Configuration
MUST_RUN