✓
Passing This code compiles and runs correctly.
Code
// Mid-chain unbound obligation leak — the continuation-level twin flagged OPEN in
// frag-obligation-enforcement-keys-off-return-binding. `bump` returns a fresh
// <owned!>, but the chain `make(): h |> bump(h)` ends UNBOUND. Enforcement mints
// and checks an obligation only when the invocation carries a return_binding, so a
// dangling obligation on an unbound continuation is neither discharged nor flagged.
// It must be caught (KORU030 "was not discharged"), never leak silently at exit 0.
// The head-only discard-materialization does not reach this continuation-level case.
const std = @import("std");
const Handle = struct { n: i32 };
~tor make {} -> *Handle<owned!>
~proc make|zig { const h = std.heap.page_allocator.create(Handle) catch unreachable; h.* = .{ .n = 5 }; return h; }
~tor bump { h: *Handle<!owned> } -> *Handle<owned!>
~proc bump|zig { h.n += 1; return h; }
~tor dispose { h: *Handle<!owned> }
~proc dispose|zig { std.debug.print("disposed n={}\n", .{h.n}); std.heap.page_allocator.destroy(h); }
~make(): h |> bump(h)
Output must match:
MUST_ERROR
BACKEND_COMPILE_ERROR
CONTAINS error[KORU030]
CONTAINS was not dischargedFlows
flow ~make click a branch to expand · @labels scroll to their anchor
make