✓
Passing Passing: the compiler rejects this program as expected.
Code
~import app/fs
~app/fs:open(path: "test.txt")
Supporting Files
// Library module: fs
// NO disposal event defined - should error
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;
}
// Oops! No close() or any event with <!opened> defined!
// This is a library bug - no way to satisfy the obligation
Actual compiler output
error[KORU030]: Resource '*File' obligation <opened!> was not discharged. No tor accepts <!opened>.
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_043_auto_discharge_none/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:
was not dischargedError output must contain
No disposal event foundFlows
flow ~open click a branch to expand · @labels scroll to their anchor
open (path: "test.txt")
Test Configuration
MUST_ERROR