✓
Passing Passing: the compiler rejects this program as expected.
Code
// scan dispatches INTO each match — effect semantics. A terminal `|` pattern
// (fire-once) is the wrong kind and is rejected loudly, mirroring the orisha
// router's rejection of terminal route branches. Use `!`.
import std/io
import std/regex
std/regex:scan(input: "42")
| `[0-9]+` n |> std/io:print.ln("oops")
| done |> std/io:print.ln("done")
Actual compiler output
error[KORU162]: std/regex:scan pattern `[0-9]+` must be an effect branch `!` (it fires once per match), not a terminal `|`
--> tests/regression/600_STDLIB/640_REGEX/640_015_scan_reject_terminal/input.k:7:0Must contain:
must be an effect branch `!`Flows
flow ~scan click a branch to expand · @labels scroll to their anchor
scan (input: "42")
Test Configuration
MUST_ERROR