✓
Passing Passing: the compiler rejects this program as expected.
Code
~import app/fs
~app/fs:open(path: "test.txt")
Supporting Files
// Library module: fs
// Multiple disposal events - requires explicit choice
const std = @import("std");
const File = struct { handle: i32 };
// Open a file - returns opened! state (requires cleanup)
~pub tor open { path: string } -> *File<opened!>
~proc open|zig {
const f = std.heap.page_allocator.create(File) catch unreachable;
f.* = File{ .handle = 42 };
return f;
}
// Close - saves any changes before closing
~pub tor close { file: *File<!opened> }
~proc close|zig {
std.debug.print("Closing file (saving changes)\n", .{});
}
// Abandon - discards any changes
~pub tor abandon { file: *File<!opened> }
~proc abandon|zig {
std.debug.print("Abandoning file (discarding changes)\n", .{});
}
Actual compiler output
error[KORU030]: Resource '*File' <opened!> has multiple discharge options: close, abandon. Discharge explicitly.
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_011_auto_discharge_multiple/input.kz:2:0
❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must contain:
multiple discharge optionsError output must contain
Multiple discharge optionsFlows
flow ~open click a branch to expand · @labels scroll to their anchor
open (path: "test.txt")
Test Configuration
MUST_ERROR