✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a nameless entry in a branch constructor — `=> ok { a: 1, : 2 }` —
// refuses PARSE003 at the constructor line. An empty field name emits `. = 2`
// in Zig; the constructor field loop refuses it before emit.
import std/io
tor f { a: i64 }
| ok { a: i64, b: i64 }
| bad i64
f => ok { a: 1, : 2 }
f(a: 1)
| ok o |> std/io:print.ln("{{ o.a:d }}")
| bad _ |> _
Actual compiler output
error[PARSE003]: field has no name — a field is `name: value` or a bare punnable name; `: value` dropped the name
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_295_ctor_nameless_field_refused/input.k:10:1
|
10 | f => ok { a: 1, : 2 }
| ^Frontend must reject with:
CONTAINS error[PARSE003]
CONTAINS field has no name
ERROR_AT 10
NOT_CONTAINS output_emitted.zigTest Configuration
MUST_ERROR