✓
Passing This code compiles and runs correctly.
Code
// Same shape as 330_099 (record-field obligation routed through a subflow's
// bare-return boundary), but this time the caller DOES issue an explicit
// discharge on the field: `dispose(res.h)`. This pin used to EXPECT the
// charged-but-unpayable misdiagnosis — a "Phantom state mismatch" refusal at
// the explicit dispose, since the field's obligation died at the subflow
// boundary while still counting as a drop-debt (800_010 deadbolt frontier 1).
//
// That misdiagnosis is FIXED: the subflow produce edge now verifies each
// declared `<state!>` field is fed a live obligation (330_139/330_140 pin the
// refusals), the caller is seeded `res.<field>` debts, and `dispose(res.h)`
// pays the field exactly as a direct call does (330_138 is the literal-produce
// twin). The pass-through produce `-> r` also repacks the record field-wise —
// two tors' record returns are nominally distinct Zig types — which is what
// lets this program reach codegen at all.
~import std/io
const std = @import("std");
const Handle = struct { n: i32 };
~tor make { id: usize } -> { h: *Handle<owned!>, n: i64 }
~proc make|zig { const h = std.heap.page_allocator.create(Handle) catch unreachable; h.* = .{ .n = 5 }; return .{ .h = h, .n = 7 }; }
~tor dispose { h: *Handle<!owned> }
~proc dispose|zig { std.heap.page_allocator.destroy(h); }
~tor spin { id: usize } -> { h: *Handle<owned!>, n: i64 }
~spin = make(id): r -> r
~spin(id: 1): res |> dispose(res.h): _ |> std/io:print.ln("n={{ res.n:d }}")
Actual
n=7
Expected output
n=7
Flows
subflow ~spin click a branch to expand · @labels scroll to their anchor
make (id)
flow ~spin click a branch to expand · @labels scroll to their anchor
spin (id: 1)
Test Configuration
MUST_RUN