✓
Passing This code compiles and runs correctly.
Code
pub const File = struct {
handle: usize,
};
~tor open-file { path: string } -> *File<open>
~tor close-file { file: *File<closed> }
~tor read-file { file: *File<open> }
~tor write-file { file: *File<open> }
~proc open-file|zig {
const f = File{ .handle = 42 };
return &f;
}
~proc close-file|zig {
_ = file;
return .{ .done = .{} };
}
~proc read-file|zig {
_ = file;
}
~proc write-file|zig {
_ = file;
return .{ .done = .{} };
}
~open-file(path: "test1.txt"): o |> close-file(o.file)
~open-file(path: "test2.txt"): o |> close-file(o.file)
~open-file(path: "test3.txt"): o |> close-file(o.file)
Must contain:
Phantom state mismatchFlows
flow ~open-file click a branch to expand · @labels scroll to their anchor
open-file (path: "test1.txt")
flow ~open-file click a branch to expand · @labels scroll to their anchor
open-file (path: "test2.txt")
flow ~open-file click a branch to expand · @labels scroll to their anchor
open-file (path: "test3.txt")