✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a valueless entry in a branch constructor — `=> ok { a: 1, b: }` —
// refuses PARSE003 at the constructor line. An empty field value emits
// `.b = ` 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, b: }
f(a: 1)
| ok o |> std/io:print.ln("{{ o.a:d }}")
| bad _ |> _
Actual compiler output
error[PARSE003]: field 'b' has no value — a field is `name: value`; `b:` dropped the value
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_296_ctor_typeless_field_refused/input.k:10:1
|
10 | f => ok { a: 1, b: }
| ^Frontend must reject with:
CONTAINS error[PARSE003]
CONTAINS field 'b' has no value
ERROR_AT 10
NOT_CONTAINS output_emitted.zigTest Configuration
MUST_ERROR