✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: `<!*>` is not a discharge spelling. `!` promises to settle a NAMED
// obligation's contract — the discharger performs the minting module's
// cleanup semantics — and `*` names nothing. Every spelling that marks a
// wildcard member as consuming is refused with KORU033: `<!*>`,
// `<!module:*>`, `<module:!*>`, and union members (`<!*|open>`,
// `<open|!*>`). The borrow wildcard `<*>` remains legal — it makes no
// settlement promise.
const std = @import("std");
const Handle = struct { n: i32 };
~tor open {} -> *Handle<opened!>
~proc open|zig {
const h = std.heap.page_allocator.create(Handle) catch unreachable;
h.* = .{ .n = 1 };
return h;
}
~tor dispose { h: *Handle<!*> }
~proc dispose|zig { std.heap.page_allocator.destroy(h); }
~open(): h1 |> dispose(h: h1)
Actual compiler output
error[KORU033]: Invalid phantom annotation '<!*>' (tor: dispose): '!' promises to settle a NAMED obligation's contract — '*' names none. Use '<!module:state>' to discharge, or '<*>' to borrow any qualification.
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_137_wildcard_consume_refused/input.kz:18:0
❌ Compiler coordination error: Phantom semantic validation failed
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must fail at runtime:
Program must error when executed.
Error output must contain
Invalid phantom annotation '<!*>' (tor: dispose): '!' promises to settle a NAMED obligation's contract — '*' names noneFlows
flow ~open click a branch to expand · @labels scroll to their anchor
open
Test Configuration
MUST_ERROR