✓
Passing Passing: the compiler rejects this program as expected.
Code
~import std/io
// `! each` and `! reverse-each` are alternative delivery axes of one call —
// attaching both means the call describes two traversals, which is refused:
// a single `for` call is a single traversal. Pick an axis.
~for(1..5)
! each i |> std/io:print.ln("{{ i:d }}")
! reverse-each i |> std/io:print.ln("{{ i:d }}")
Actual compiler output
error[KORU120]: for: `! each` and `! reverse-each` cannot both attach to one call — pick an axis (a single call is a single traversal)
--> tests/regression/400_RUNTIME_FEATURES/400_226_for_each_reverse_each_refused/input.kz:8:1Error output must contain
`! each` and `! reverse-each` cannot both attach to one call — pick an axisFlows
flow ~for click a branch to expand · @labels scroll to their anchor
for (1..5)
Test Configuration
MUST_ERROR