✓
Passing This code compiles and runs correctly.
Code
~import app/fs
const std = @import("std");
~app/fs:open(path: "first.txt")
| opened _ |> app/fs:open(path: "second.txt")
| opened 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
Imported Files
const std = @import("std");
const File = struct { handle: i32 };
~pub event open { path: []const u8 }
| opened *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 .{ .opened = f };
}
~pub event close { file: *File<!opened> }
~proc close|zig {
std.debug.print("Closing file\n", .{});
}
Test Configuration
MUST_RUN