✓
Passing Passing: the compiler rejects this program as expected.
Code
pub const Handle = struct {
id: i32,
};
~tor open {} -> *Handle<open!>
~proc open|zig {
const h = std.heap.page_allocator.create(Handle) catch unreachable;
h.* = .{ .id = 42 };
return h;
}
~tor close { h: *Handle<!open> } -> string
~proc close|zig {
std.heap.page_allocator.destroy(h);
}
const std = @import("std");
~open()
Actual compiler output
error[KORU030]: Resource '*Handle' obligation <open!> was not discharged. Call one of: close
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_036_autodischarge_no_void_candidate/input.kz:15:0
❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
(set KORU_BACKEND_TRACE=1 for the backend return trace)Compiler must reject:
Compilation must fail with a diagnostic.
Flows
flow ~open click a branch to expand · @labels scroll to their anchor
open
Test Configuration
MUST_ERROR