✗
Failing This test is currently failing.
Failed: error-output
Failure Output
error[KORU010]: '_' is only legal as the body of a branch handler
--> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_016_reject_continuation_without_branch_handler/input.kz:21:0
|
21 | |> _
| ^
hint: '_' has meaning only as `| branch [binding] |> _`. Outside a branch handler body — top-level void chain, split-pipeline tail — `|> _` is meaningless. Code
// TEST: Reject a continuation provided without any branch handler.
//
// Every continuation in a flow must be a response to a named branch of the
// preceding event. Bare `|>` tries to chain the next event without naming
// which branch it handles — there is no implicit "positive case," no
// default, no fallback. Every branch must be named explicitly.
//
// Legal: | ok |> next()
// Legal: | err _ |> next()
// Illegal: |> next() (no branch handler — which branch is this?)
~tor ping {}
| ok
| err string
~proc ping|zig {
return .{ .ok = .{} };
}
~ping()
|> _
| err _ |> _
Must fail at frontend compile:
Parsing or type-checking must reject the program.
Expected compiler error
error[KORU010]: '|>' cannot start a line
--> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_016_reject_continuation_without_branch_handler/input.kz:21:0
|
21 | |> _
| ^^
hint: '|>' is inline glue, never a line start — it joins a branch handler to its body and chains steps on one line.
• Keep the chain inline regardless of length.
• If a step ends in a multi-line { } block, put the next |> on the same line as that block's closing } : pairwise { ... } |> self { ... }
• Void chains may instead split into separate top-level statements (~A() then ~B()).
• Drop a trailing |> _ if the head already suffices.