✓
Passing This code compiles and runs correctly.
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)
Backend must reject with:
CONTAINS Cannot issue obligation
CONTAINS input parameterFlows
flow ~mk click a branch to expand · @labels scroll to their anchor
mk