✓
Passing This code compiles and runs correctly.
Code
// PINS: a phantom state transition through a chain — <open> in, <closed> out —
// with the terminal return discarded. Non-obligation states (no `!`) impose no
// discharge; the trailing `: _` is a genuine discard.
const std = @import("std");
~tor open-file {} -> *std.fs.File<open>
~proc open-file|zig {
std.debug.print("File opened\n", .{});
const allocator = std.heap.page_allocator;
const f = allocator.create(std.fs.File) catch unreachable;
return f;
}
~tor close-file { file: *std.fs.File<open> } -> *std.fs.File<closed>
~proc close-file|zig {
std.debug.print("File closed\n", .{});
return file;
}
~open-file(): o |> close-file(file: o): _
Actual
File opened
File closed
Expected output
File opened
File closed
Flows
flow ~open-file click a branch to expand · @labels scroll to their anchor
open-file
Test Configuration
MUST_RUN