✓
Passing This code compiles and runs correctly.
Code
// FEATURE SPEC: three independent obligation fields discharge one-by-one,
// narrowing {a!,b!,c!} -> {b!,c!} -> {c!} (collapse to scalar) -> clean. Pins the
// cascade across more than one narrowing step. RED until field-projected
// discharge is credited.
~import std/io
const std = @import("std");
const Handle = struct { n: i32 };
~tor dispose { x: *Handle<!owned> }
~proc dispose|zig { std.heap.page_allocator.destroy(x); }
~tor make3 { id: usize } -> { a: *Handle<owned!>, b: *Handle<owned!>, c: *Handle<owned!> }
~proc make3|zig { const a = std.heap.page_allocator.create(Handle) catch unreachable; const b = std.heap.page_allocator.create(Handle) catch unreachable; const c = std.heap.page_allocator.create(Handle) catch unreachable; a.* = .{ .n = 1 }; b.* = .{ .n = 2 }; c.* = .{ .n = 3 }; return .{ .a = a, .b = b, .c = c }; }
~make3(id: 1): s |> dispose(x: s.a): _ |> dispose(x: s.b): _ |> dispose(x: s.c): _ |> std/io:print.ln("clean")
Actual
clean
Expected output
clean
Flows
flow ~make3 click a branch to expand · @labels scroll to their anchor
make3 (id: 1)
Test Configuration
MUST_RUN