✓
Passing Passing: the compiler rejects this program as expected.
Code
// TEST: std/kernel — `scan` with no `{k}.<field>` write is refused (KORU123):
// a scan's output IS the mutated elements, so accumulator-only state is
// dead compute trapped in the kernel scope with no exit. Same doctrine as
// the computed-less kernel refusal.
import std/kernel
import std/io
std/kernel:shape(Pt) {
mass: f64,
}
std/kernel:init(Pt) {
{ mass: 1.0 },
{ mass: 2.0 },
}
| kernel k |> std/kernel:scan {
run[f64]
run += k.mass
}
| computed c |> std/io:print.ln("unreachable")
Actual compiler output
error[KORU123]: std/kernel:scan produced no element write — its output IS the mutated elements, so at least one statement must assign `k.<field>`; accumulator-only state has no exitError output must contain
std/kernel:scan produced no element writeFlows
flow ~shape click a branch to expand · @labels scroll to their anchor
shape (expr: Pt, source: mass: f64,)
flow ~init click a branch to expand · @labels scroll to their anchor
init (expr: Pt, source: { mass: 1.0 },
{ mass: 2.0 },)
Test Configuration
MUST_ERROR