✓
Passing This code compiles and runs correctly.
Code
// TEST: `_` is legal ONLY as the (sole) body of a branch handler.
//
// The terminal `_` means "this branch handler intentionally does nothing";
// it has meaning only in `| branch [binding] |> _`. At the top level, or as
// a split-pipeline tail, there is no branch handler for `_` to be the body
// of — so `|> _` is meaningless and rejected.
//
// A void event is NOT special here: it chains monadically like anything
// else (`~hello() |> next()` is legal). What is rejected is the misplaced
// `_`, never "a redundant terminator after a void event".
//
// Legal: ~hello()
// Legal: ~hello() |> next()
// Illegal: ~hello() |> _
~tor hello {}
~proc hello|zig {}
~hello()
|> _
Frontend must reject with:
CONTAINS error[KORU010
CONTAINS only legal as the body of a branch handlerExpected compiler error
error[KORU010]: '_' is only legal as the body of a branch handler
--> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_014_reject_underscore_outside_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.