✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a kernel:init dataset field list with a dropped comma —
// `x: 42.0 y: 0` — refuses KORU170 naming the fused field. init's splitters
// are bare comma splits; the one field parser (struct_literal.parseFields)
// validates the list before they run, so the fused line never reaches the
// emitted static as `.x = 42.0 y: 0`.
import std/kernel
import std/io
std/kernel:shape(Body) {
x: f64,
y: f64,
mass: f64,
}
std/kernel:init(Body) {
x: 42.0
y: 0,
mass: 1.5,
}
std/io:print.ln("unreachable")
Actual compiler output
error[KORU170]: kernel:init missing comma — 'y: 0' began a new field but was read as part of the field above it; separate fields with commas
--> tests/regression/300_ADVANCED_FEATURES/390_KERNEL/390_127_kernel_init_fused_field_refused/input.k:15:0Must fail at runtime with:
CONTAINS error[KORU170]
CONTAINS missing comma
CONTAINS 'y: 0'Flows
flow ~shape click a branch to expand · @labels scroll to their anchor
shape (expr: Body, source: x: f64,
y: f64,
mass: f64,)
flow ~init click a branch to expand · @labels scroll to their anchor
init (expr: Body, source: x: 42.0
y: 0,
mass: 1.5,)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreachable")
Test Configuration
MUST_ERROR