✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a bare name in a `const { }` block — `x` with no `: value` — is
// refused KORU176. Const has no pun: nothing at container scope exists to
// bind the name from, so the entry would silently declare nothing.
import std/io
const {
a: @as(i32, 5), x
}
std/io:print.ln("unreachable")
Actual compiler output
error[KORU176]: field has no value — a field is `name: value`; `name:` dropped the value
--> tests/regression/300_ADVANCED_FEATURES/320_STDLIB/320_118_const_field_bare_entry_refused/input.k:7:0Must fail at runtime with:
CONTAINS error[KORU176]
CONTAINS field has no value
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), x)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreachable")
Test Configuration
MUST_ERROR