✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// Test 210_089: MUST_FAIL — explicit label `v: p.q.v` at a call site is
// forbidden because the path puns to `v`.
//
// Punning takes the last segment of a dot-separated identifier path as the
// parameter name. `p.q.v` puns to `v`, so the explicit label `v:` is
// redundant. Canonical form: `echo(p.q.v)`.
// ============================================================================
~import std/io
~event echo { v: i32 }
| out i32
~echo => out v
~event get-box { }
| got { v: i32, other: i32 }
~proc get-box|zig {
return .{ .got = .{ .v = 7, .other = 11 } };
}
~get-box()
| got box |> echo(v: box.v)
| out r |> std/io:print.ln("{{ r:d }}")
Must fail at frontend compile:
Parsing or type-checking must reject the program.