✓
Passing This code compiles and runs correctly.
Code
~import app/fs
~app/fs:my-subflow()
| file-opened f |> app/fs:close(file: f)
Actual
Opening file: data.txt
Closing file
Expected output
Opening file: data.txt
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 file: {s}\n", .{path});
const allocator = std.heap.page_allocator;
const f = 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", .{});
}
// Subflow that opens a file and returns it with obligation
// The obligation escapes via the return signature - caller must handle it
~pub event my-subflow {}
| file-opened *File<opened!>
// SUBFLOW: Delegates to open, maps opened → file-opened
// The [opened!] obligation passes through to the caller
~my-subflow = open(path: "data.txt")
| opened f => file-opened f
Test Configuration
MUST_RUN