✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a `const { }` entry with no name — `: @as(i32, 2)` — is refused
// KORU176, not silently dropped from the emitted declarations. The caret
// lands on the line carrying the nameless entry.
import std/io
const {
a: @as(i32, 5), : @as(i32, 2)
}
std/io:print.ln("unreachable")
Actual compiler output
error[KORU176]: field has no name — a field is `name: value` or a bare punnable name; `: value` dropped the name
--> tests/regression/300_ADVANCED_FEATURES/320_STDLIB/320_115_const_field_nameless_entry_refused/input.k:7:0Must fail at runtime with:
CONTAINS error[KORU176]
CONTAINS field has no name
ERROR_AT 7
NOT_CONTAINS output_emitted.zigFlows
flow ~const click a branch to expand · @labels scroll to their anchor
const (source: a: @as(i32, 5), : @as(i32, 2))
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreachable")
Test Configuration
MUST_ERROR