✓
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 _ |> _
| done |> _
Actual compiler output
error[KORU025]: branch 'each' is declared as effect `!` but the handler uses terminal `|`
--> tests/regression/300_ADVANCED_FEATURES/320_STDLIB/320_048_reject_for_terminal_each/input.kz:22:0
hint: match the handler glyph to the declaration: write `! each ... |> ...` to handle this branch
❌ Compiler coordination error: Incomplete branch coverage
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must contain:
error[KORU025]Flows
flow ~start click a branch to expand · @labels scroll to their anchor
start
Test Configuration
MUST_ERROR