✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a grid write block whose second field carries an indexed head —
// `cells[0].a: 3.0 cells[0].b: 7.0` — fuses for want of a comma and refuses
// KORU161. Write heads `name[i].field:` are field boundaries the shared
// fused-field detector sees, same as a bare `name:`.
import std/io
import std/grid
std/grid:new(cells, size: 4) { a: 0.0[f64], b: 0.0[f64] }
std/grid:stored { cells[0].a: 3.0 cells[0].b: 7.0 }
std/io:print.ln("x {{ cells[0].a:f }}")
Actual compiler output
error[KORU161]: std/grid:stored: missing comma — 'cells[0].b: 7.0' began a new field but was read as part of the field above it; separate fields with commas
--> tests/regression/600_STDLIB/697_GRID/697_015_grid_stored_fused_indexed_head_refused/input.k:10:0Must fail at runtime with:
CONTAINS error[KORU161]
CONTAINS missing comma
CONTAINS 'cells[0].b: 7.0'Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (cells, size: 4, source: a: 0.0[f64], b: 0.0[f64])
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: cells[0].a: 3.0 cells[0].b: 7.0)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "x {{ cells[0].a:f }}")
Test Configuration
MUST_ERROR