✗
Failing This test is currently failing.
Failed: frontend
Failure Output
error[KORU010]: stray continuation line without Koru construct
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_086_inline_nested_fold_outer_obligation/input.kz:43:5
|
43 | | stop r -> r
| ^ Code
// PROBE — the EXACT Limitation 1 shape: outer fold carries obligation v; INSIDE
// the outer `again` branch (same scope, v live) an INLINE inner fold runs over a
// scalar; at the inner back-edge `@iloop(c: k)` v is live+uncleaned but is NOT
// the inner loop's to consume. If per-loop ownership is missing, the inner
// back-edge false-flags v as a dropped obligation (KORU030).
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 < 2) return .{ .again = h };
return .{ .stop = h };
}
~tor icount { c: i32 }
| more i32
| fin i32
~proc icount|zig {
if (c < 2) return .{ .more = c + 1 };
return .{ .fin = c };
}
~tor dispose { h: *Handle<!owned> }
~proc dispose|zig {
std.debug.print("n={}\n", .{h.n});
std.heap.page_allocator.destroy(h);
}
~tor spin {} -> *Handle<owned!>
~spin = make(): h0 |> #oloop step(h: h0): v |> #iloop icount(c: 0): k |> @iloop(c: k)
| fin _ |> @oloop(h: v)
| stop r -> r
~spin(): hf |> dispose(h: hf)
Expected output
n=2
Flows
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