✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a typeless/valueless entry in a bare-return record produce —
// `-> { a: 1, b: }` — refuses PARSE003. An empty field value emits `.b = ` in
// Zig; the refusal names the malformed field at the authored line.
import std/io
pub tor f { a: i64 } -> { a: i64, b: i64 }
f -> { a: 1, b: }
f(a: 4): r |> std/io:print.ln("{{ r.a:d }}")
Actual compiler output
error[PARSE003]: malformed record value `{ a: 1, b: }` in the bare return — field has no value — a field is `name: value`; `name:` dropped the value
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_290_bare_return_empty_field_value_refused/input.k:7:0
|
7 | f -> { a: 1, b: }
| ^Frontend must reject with:
CONTAINS error[PARSE003]
CONTAINS field has no value
ERROR_AT 7
NOT_CONTAINS output_emitted.zigFlows
flow ~f click a branch to expand · @labels scroll to their anchor
f (a: 4)
Test Configuration
MUST_ERROR