✓
Passing This code compiles and runs correctly.
Code
import app/fs
app/fs:open(path: "first.txt"): _ |> app/fs:open(path: "second.txt"): f2 |> app/fs:close(file: f2)
Actual
Opening: first.txt
Opening: second.txt
Closing file
Closing file
Expected output
Opening: first.txt
Opening: second.txt
Closing file
Closing file
Flows
flow ~open click a branch to expand · @labels scroll to their anchor
open (path: "first.txt")
Imported Files
const std = @import("std");
const File = struct { handle: i32 };
~pub event open { path: []const u8 } -> *File<opened!>
~proc open|zig {
std.debug.print("Opening: {s}\n", .{path});
const f = std.heap.page_allocator.create(File) catch unreachable;
f.* = File{ .handle = 42 };
return f;
}
~pub event close { file: *File<!opened> }
~proc close|zig {
std.debug.print("Closing file\n", .{});
}
Test Configuration
MUST_RUN