✓
Passing Passing: the compiler rejects this program as expected.
Code
// PIN (phantom_semantic_checker — NOT the parser; phantom types stay opaque
// through parsing): an INPUT parameter may CONSUME an obligation (<!owned>) or
// REQUIRE/borrow a state (<owned>), but may NEVER ISSUE one (<owned!>). Issuing
// on an incoming value is nonsense — it claims the call creates a fresh
// obligation on a value it was handed; a `read`-style borrow requires the state,
// it does not re-open the resource. Only a RETURN issues.
//
// The wall EXISTS and WORKS — KORU033 at phantom_semantic_checker.zig:333 rejects
// exactly this ("Cannot issue obligation '<owned!>' on input parameter ..."), and
// it fires correctly under `--auto-discharge=disable`. It is DORMANT by default
// because of PASS ORDERING: the auto-discharge pass runs first, sees the issued-
// but-undischarged obligation, and halts with a spurious KORU030 leak before the
// phantom signature validation rejects it. Fix = run phantom signature/polarity
// validation BEFORE auto-discharge (a declaration error precedes flow analysis).
// EXPECT already matches KORU033's live message, so the reorder greens this pin.
~import std/io
const std = @import("std");
const Handle = struct { n: i32 };
~tor mk { } -> *Handle<owned!>
~proc mk|zig { const h = std.heap.page_allocator.create(Handle) catch unreachable; h.* = .{ .n = 1 }; return h; }
~tor use { r: *Handle<owned!> }
~proc use|zig { _ = r; }
~mk(): r |> use(r)
Actual compiler output
error[KORU033]: Cannot issue obligation '<owned!>' on input parameter (event: use). Use '<!owned>' to consume an existing obligation, or remove the '!' suffix.
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_110_reject_issue_obligation_in_input/input.kz:23:0
❌ Compiler coordination error: Phantom semantic validation failed
(set KORU_BACKEND_TRACE=1 for the backend return trace)Backend must reject with:
CONTAINS Cannot issue obligation
CONTAINS input parameterFlows
flow ~mk click a branch to expand · @labels scroll to their anchor
mk
Test Configuration
MUST_ERROR