✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test 320_048: MUST_ERROR — reject the pre-migration `for(...) | each |>` form.
//
// `for`'s `each` is an EFFECT branch (declared `! each *` in std/control), so
// handling it with a terminal `|` continuation is illegal. The compiler must
// reject it with a clear KORU025 error whose hint points the user at the fix
// (`! each`). This pins the rejection of the old terminal-each syntax after the
// for→effect-branch migration; the legal form lives next door in 320_040
// (`! each _ |> _`). Lars's requirement: the invalid form must fail with a
// SENSIBLE message, not just fail — hence the CONTAINS assertions on the hint.
~import std/control
const std = @import("std");
~tor start {}
~proc start|zig {
}
~start() |> for(&[_]i32{1, 2, 3})
| each _ |> _
Actual compiler output
error[KORU120]: for: `each` is an effect arm — write `! each`, not `| each` (the traversal delivers through `!` handlers, `|` arms are for the terminal axes)
--> generated:0:0Must fail at runtime:
Program must error when executed.
Error output must contain
`each` is an effect armFlows
flow ~start click a branch to expand · @labels scroll to their anchor
start
Test Configuration
MUST_ERROR