✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a kernel:shape declaration field list with a dropped comma —
// `y: f64\n mass: f64` — refuses KORU170 naming the fused field when init
// consumes it, instead of emitting `y: f64 mass: f64` into the host struct
// decl and dying in backend Zig.
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 — 'mass: f64' 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_128_kernel_shape_fused_field_refused/input.k:14:0Must fail at runtime with:
CONTAINS error[KORU170]
CONTAINS missing comma
CONTAINS 'mass: f64'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