✓
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");
Actual compiler output
error[KORU083]: [!] annotation requires a void tor (no branches, no `-> T` return) - a tor with output cannot be auto-inserted
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_037_default_discharge_must_be_void/input.kz:10: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.
Test Configuration
MUST_ERROR