✓
Passing Passing: the compiler rejects this program as expected.
Code
// Pins: a [parallel]for inside a [parallel]for's each body refuses — the
// lowering emits one worker fn per for, and a second fork inside it used
// to reach Zig as shadow errors on `__koru_par_*` names the author never
// wrote.
import std/io
capture { acc: 0[i64] }
! as a |> [parallel]for(1..5)
! each i |> [parallel]for(1..5)
! each j |> captured { acc: a.acc + @as(i64, @intCast(i * j)) }
| captured r |> std/io:print.ln("{{ r.acc:d }}")
Actual compiler output
error[KORU212]: [parallel]for: a [parallel] scope cannot nest inside a [parallel] body — the worker fn emits no second fork; hoist the inner [parallel] out of the loop or drop the annotation
--> tests/regression/400_RUNTIME_FEATURES/400_233_parallel_for_nested_parallel_refused/input.k:10:5Error output must contain
cannot nest inside a [parallel]Flows
flow ~capture click a branch to expand · @labels scroll to their anchor
capture (source: acc: 0[i64])
Test Configuration
MUST_ERROR