✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a `const { }` entry fused onto the previous field's line for want of
// a comma — `a: @as(i32, 5) b: @as(i32, 2)` — is refused KORU176 naming the
// fused field, under the same missing-comma rule every other field list is
// held to. The caret lands on the line carrying the fused pair.
import std/io
const {
a: @as(i32, 5) b: @as(i32, 2)
}
std/io:print.ln("unreachable")
Actual compiler output
error[KORU176]: missing comma — 'b: @as(i32, 2)' began a new field but was read as part of the field above it; separate fields with commas
--> tests/regression/300_ADVANCED_FEATURES/320_STDLIB/320_114_const_field_missing_comma_refused/input.k:8:0Must fail at runtime with:
CONTAINS error[KORU176]
CONTAINS missing comma
CONTAINS 'b: @as(i32, 2)'
ERROR_AT 8
NOT_CONTAINS output_emitted.zigFlows
flow ~const click a branch to expand · @labels scroll to their anchor
const (source: a: @as(i32, 5) b: @as(i32, 2))
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreachable")
Test Configuration
MUST_ERROR