✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a comma-less multi-line store field list is refused with a diagnostic
// that names the missing comma — not a fused-column type error. Without the
// trailing comma, the field splitter reads `label`'s type as
// `*std/string:String<std/string:instance!>\ndone: i64` — two fields fused
// into one type string — and the refusal used to report that whole string as
// the column type, leaving the author to debug a type error that is really a
// punctuation error.
import std/io
import std/string
import std/store
std/store:new(tasks, capacity: 8) {
label: *std/string:String<std/string:instance!>
done: i64
}
std/io:print.ln("unreachable")
Actual compiler output
error[KORU161]: std/store:new(tasks): missing comma — 'done: i64' began a new field but was read as part of the field above it; separate fields with commas
--> tests/regression/600_STDLIB/690_STORE/690_344_comma_less_field_list_names_missing_comma/input.k:13:0Must fail at runtime with:
CONTAINS missing comma
CONTAINS 'done: i64'Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (tasks, capacity: 8, source: label: *std/string:String<std/string:instance!>
done: i64)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreachable")
Test Configuration
MUST_ERROR