✓
Passing This code compiles and runs correctly.
Code
// PINS: the head invocation's return destructure is a binding list too.
// `~f(): { name, name }` refuses PARSE010 on the call line, in the
// frontend. Bind-position twin of 210_269: the same law holds whether
// the destructure sits on a continuation or on the invocation that
// produces the value.
~import std/io
~tor fetch { id: i64 }
| found { name: string, age: i64 }
| missing
~proc fetch|zig {
if (id == 1) return .{ .found = .{ .name = "lars", .age = 44 } };
return .{ .missing = .{} };
}
~fetch(id: 1): { name, name }
| found |> std/io:print.ln("{{ name:s }}")
| missing |> std/io:print.ln("nope")
Frontend must reject with:
CONTAINS error[PARSE010]
CONTAINS 'name'
CONTAINS bound twice
ERROR_AT 17
NOT_CONTAINS output_emitted.zigFlows
flow ~fetch click a branch to expand · @labels scroll to their anchor
fetch (id: 1)