✓
Passing This code compiles and runs correctly.
Code
// PROBE for Limitation 1 (per-loop obligation ownership across NESTED loops):
// the OUTER label-fold carries an owned obligation `v`; inside the `again`
// branch — while `v` is live — an INNER label-fold runs (the subflow `inner`,
// itself a #iloop fold over a scalar), then the outer back-edge
// `@oloop(h: v)` carries `v` forward. The claim: no false-flag of `v` as a
// dropped obligation anywhere in the nest — program compiles and prints n=3.
//
// HISTORY: written 2026-07-24 with an inline mid-chain fold head binding
// (`#oloop step(h: h0): v |> inner(): _ |> @oloop(h: v)`); KORU022 refused
// it ("required branch 'again' not handled") because the fold head was
// spelled as a bound chain step, and 074 documents why head-binding is
// wrong anyway ("binds something that does not exist"). Re-spelled
// 2026-08-25: arms below the fold carry the binding, mid-arm call grounded
// on 330_083, punning spelled bare per PARSE005. Measured TRUE: compiles,
// runs, n=3. NOTE the nuance: inner runs as a SUBFLOW, so its @iloop jumps
// never see `v` in scope — this pin proves no cross-flow false-flag, not
// that the jump-conservation check is per-label within one scope. The
// same-scope variant of that question remains open (see 330_086).
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 = 0 };
return h;
}
~tor step { h: *Handle<!owned> }
| again *Handle<owned!>
| stop *Handle<owned!>
~proc step|zig {
h.n += 1;
if (h.n < 3) return .{ .again = h };
return .{ .stop = h };
}
~tor done { h: *Handle<!owned> }
~proc done|zig {
std.debug.print("n={}\n", .{h.n});
std.heap.page_allocator.destroy(h);
}
~tor icount { k: i64 }
| imore i64
| idone i64
~proc icount|zig {
if (k > 0) return .{ .imore = k - 1 };
return .{ .idone = k };
}
~tor inner {} -> i64
~inner = #iloop icount(k: 2)
| imore k2 |> @iloop(k: k2)
| idone r -> r
~tor spin {} -> *Handle<owned!>
~spin = make(): h0 |> #oloop step(h: h0)
| again v |> inner(): _ |> @oloop(h: v)
| stop r -> r
~spin(): hf |> done(h: hf)
Actual
n=3
Expected output
n=3
Flows
subflow ~inner click a branch to expand · @labels scroll to their anchor
#iloop icount (k: 2)
subflow ~spin click a branch to expand · @labels scroll to their anchor
make
flow ~spin click a branch to expand · @labels scroll to their anchor
spin
Test Configuration
MUST_RUN