✓
Passing This code compiles and runs correctly.
Code
// Pins: a bare-return bind that DISCARDS an obligation-carrying value
// (`bump(h): _`) auto-discharges it, exactly as the old `| tag _ |> _` branch
// discard did — the single-return migration is mechanical, so the discard must
// behave identically. The dropped <owned!> value is materialized to a synthetic
// name so the inserted dispose() can reference it (never a bare `_` in Zig).
const std = @import("std");
const Handle = struct { n: i32 };
~event make {} -> *Handle<owned!>
~proc make|zig { const h = std.heap.page_allocator.create(Handle) catch unreachable; h.* = .{ .n = 5 }; return h; }
~event bump { h: *Handle<!owned> } -> *Handle<owned!>
~proc bump|zig { h.n += 1; return h; }
~event 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): _
Actual
disposed n=6
Expected output
disposed n=6
Flows
flow ~make click a branch to expand · @labels scroll to their anchor
make
Test Configuration
MUST_RUN