006 cleanup consumed by disposal

✓ Passing This code compiles and runs correctly.

Code

~import "$app/fs"
~app.fs:open(path: "test.txt")
| opened f |> app.fs:close(file: f)
input.kz

Expected

Opening file: test.txt
Closing file

Actual

Opening file: test.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 {
    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] }  // [!opened] means CONSUMES obligation

~proc close {
    std.debug.print("Closing file\n", .{});
}
fs.kz

Test Configuration

MUST_RUN