✓
Passing This code compiles and runs correctly.
Code
// Pins: a flow-head bare-return obligation in a CONTINUATION-LESS flow is a
// flow exit — `~make(): _` (or `: h`) issues <owned!> with nothing after it,
// so auto-discharge inserts dispose() at the head exactly as it does for a
// nested bind (330_094). The head has no terminal for the terminator-disposal
// machinery to fire on, so the inserter synthesizes one (renaming a `_` head
// bind to a referenceable synthetic first). Guards against a silent leak
// (`: _`) and a raw Zig unused-const (`: h`) — the mechanical twin of the
// nested discard.
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 dispose { h: *Handle<!owned> }
~proc dispose|zig { std.debug.print("disposed n={}\n", .{h.n}); std.heap.page_allocator.destroy(h); }
~make(): _
Actual
disposed n=5
Expected output
disposed n=5
Flows
flow ~make click a branch to expand · @labels scroll to their anchor
make
Test Configuration
MUST_RUN