009 unused binding error

○ Planned This feature is planned but not yet implemented.

OWED: unused branch binding `f` is KORU100; discard is `| opened _ |>`.

Failure Output

error[KORU010]: '_' is only legal as the body of a branch handler
  --> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_009_unused_binding_error/input.kz:13:0
    |
 13 | ~app/fs:open(path: "test.txt"): f |> _
    | ^
  hint: '_' has meaning only as `| branch [binding] |> _`. Outside a branch handler body — top-level void chain, split-pipeline tail — `|> _` is meaningless.

Code

input.kz

Supporting Files

fs.kz

Actual compiler output

error[KORU010]: '_' is only legal as the body of a branch handler
  --> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_009_unused_binding_error/input.kz:13:0
    |
 13 | ~app/fs:open(path: "test.txt"): f |> _
    | ^
  hint: '_' has meaning only as `| branch [binding] |> _`. Outside a branch handler body — top-level void chain, split-pipeline tail — `|> _` is meaningless.

Must fail at frontend compile:

Parsing or type-checking must reject the program.

Expected compiler error

error[KORU100]: unused binding 'f'
  --> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_009_unused_binding_error/input.kz:14:0
    |
 14 | | opened f |> _
    | ^
  hint: discard the binding using `_` if not needed

Test Configuration

MUST_ERROR