✓
Passing This code compiles and runs correctly.
Code
// PINS: an inline record field type `{ name: T }` is the same record shape a
// bare-return record uses (020_063), spelled in field-type position. It emits
// an anonymous Zig struct wherever parseShape reads field types: tor input
// fields, branch payload fields, and record returns — including `string`
// lowering, nested records, and qualified field types like
// `[]const threading:WorkerHandle`.
~import std/io
~import std/threading
~tor hold { r: { handles: []const threading:WorkerHandle, n: i64 } }
~proc hold|zig { _ = r; }
~tor wrap { user: { x: i64 } }
~proc wrap|zig {
const std = @import("std");
std.debug.print("{d}\n", .{user.x});
}
~tor fetch { id: i64 }
| found { user: { x: i64 }, ok: i64 }
| missing
~proc fetch|zig {
if (id == 1) return .{ .found = .{ .user = .{ .x = 5 }, .ok = 1 } };
return .{ .missing = .{} };
}
~tor make { id: i64 } -> { user: { x: i64 }, ok: i64 }
~proc make|zig { return .{ .user = .{ .x = id * 10 }, .ok = 1 }; }
~wrap(user: { x: 5 })
~fetch(id: 1)
| found f |> std/io:print.ln("{{ f.user.x:d }}{{ f.ok:d }}")
| missing |> std/io:print.ln("nope")
~make(id: 2): m |> std/io:print.ln("{{ m.user.x:d }}{{ m.ok:d }}")
Actual
5
51
201
Expected output
5
51
201
Flows
flow ~wrap click a branch to expand · @labels scroll to their anchor
wrap (user: { x: 5 })
flow ~fetch click a branch to expand · @labels scroll to their anchor
fetch (id: 1)
flow ~make click a branch to expand · @labels scroll to their anchor
make (id: 2)
Test Configuration
MUST_RUN