✓
Passing This code compiles and runs correctly.
Code
// FEATURE SPEC: a destructure need only name OBLIGATION fields — plain data may be
// dropped. Naming { h } of {h!, n:i64} (omitting plain n) is legal; discharge h ->
// clean. Contrast 330_103, where the omitted field carried an obligation and was
// caught. RED until the feature lands.
~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 makeMixed { id: usize } -> { h: *Handle<owned!>, n: i64 }
~proc makeMixed|zig { const h = std.heap.page_allocator.create(Handle) catch unreachable; h.* = .{ .n = 7 }; return .{ .h = h, .n = 7 }; }
~makeMixed(id: 1): { h } |> dispose(x: h): _ |> std/io:print.ln("clean")
Actual
clean
Expected output
clean
Flows
flow ~makeMixed click a branch to expand · @labels scroll to their anchor
makeMixed (id: 1)
Test Configuration
MUST_RUN