✓
Passing This code compiles and runs correctly.
Code
// TEST: Reject `|> _` after a void event — redundant terminator.
//
// A void event call has nothing to continue from. Writing `|> _` after
// it is pure noise: the program is bit-identical with or without the
// terminator. The flow checker rejects this so trailing `|> _` cannot
// creep in as a habit.
//
// Legal: ~hello()
// Legal: ~hello() |> next()
// Illegal: ~hello() |> _
~event hello {}
~proc hello|zig {}
~hello()
|> _
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_014_reject_void_redundant_terminator/input.kz:17:0
|
17 | |> _
| ^^
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.
Error Verification
Expected Error Pattern
redundant terminator after void eventActual Compiler Output
error[KORU010]: '|>' cannot start a line
--> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_014_reject_void_redundant_terminator/input.kz:17:0
|
17 | |> _
| ^^
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.Test Configuration
MUST_FAIL