✓
Passing This code compiles and runs correctly.
Code
// The void half of the linear bind-or-discard rule (KORU101):
// a branch that carries NO payload must be handled bindingless — there is
// nothing to bind, so there is nothing to discard either. `| done _ |>` is
// a lie about the data flowing through the program.
//
// Mirror of KORU030 ("branch has payload but no binding"). Together they are
// the full linear discipline: payload => bind or discard; void => bindingless.
const std = @import("std");
~event check {}
| ok i32
| done
~proc check|zig {
return .done;
}
~check()
| ok _ |> _
| done _ |> _
Must fail at runtime with:
CONTAINS KORU101
CONTAINS carries no payloadError Verification
Actual Compiler Output
error[KORU101]: branch 'done' carries no payload — remove the binding '_'
--> tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_015_reject_binding_on_void_branch/input.kz:19:0
❌ Compiler coordination error: Incomplete branch coverage
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_015_reject_binding_on_void_branch/backend.zig:94:13: 0x104b4a3b3 in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_015_reject_binding_on_void_branch/backend.zig:190:28: 0x104b4b09f in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^Test Configuration
MUST_FAIL