✗
Failing This test is currently failing.
Failed: wrong-error
Error Details
output_emitted.zig:120:75: error: incompatible types: 'i64' and 'usize'
Failure Output
Showing last 10 of 16 lines
~^~~~~
output_emitted.zig:120:77: note: type 'usize' here
{ const x = __koru_item4; _ = &x; a.hits = a.hits + x;
^
referenced by:
main: output_emitted.zig:292:22
callMain [inlined]: /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/std/start.zig:618:22
callMainWithArgs [inlined]: /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/std/start.zig:587:20
main: /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/std/start.zig:602:28
1 reference(s) hidden; use '-freference-trace=5' to see all references Code
// RED PIN — `| captured` arm bodies escape unknown-branch checking.
//
// `| missing` is not a branch of `std/control:if` — inside a `for`'s
// `| done` arm the identical shape refuses KORU021 "has no branch
// 'missing' (available: then, else)". Inside `| captured` it compiles
// green and the emitter renders the arm as an empty `else` — the arm's
// steps are silently dropped (they carried unbound names in the fuzz
// finding this pins: .kfuzz/findings_gp/gp_1_pass).
//
// The capture transform consumes the `| captured` subtree; whatever
// replaces it is never re-walked for branch coverage. Stays red until
// transform-produced subtrees get the same unknown-branch check as
// source-written ones.
import std/io
import std/field
std/field:new(bits: 8)
| field f |> for(1..4)
! each i |> std/field:set(f, i)
| done |> capture { hits: 0[i64] }
! as a |> for(0..2)
! each x |> captured { hits: a.hits + x }
| captured r |> if(r.hits == 0)
| then |> std/io:print.ln("then")
| missing |> std/io:print.ln("should-refuse")
| err e |> _
Actual compiler output
🎯 Compiler coordination: Passes: 20 (flow-based: elaborate, analysis, emission)
Error: output_emitted.zig:120:75: error: incompatible types: 'i64' and 'usize'
{ const x = __koru_item4; _ = &x; a.hits = a.hits + x;
~~~~~~~^~~
output_emitted.zig:120:69: note: type 'i64' here
{ const x = __koru_item4; _ = &x; a.hits = a.hits + x;
~^~~~~
output_emitted.zig:120:77: note: type 'usize' here
{ const x = __koru_item4; _ = &x; a.hits = a.hits + x;
^
referenced by:
main: output_emitted.zig:292:22
callMain [inlined]: /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/std/start.zig:618:22
callMainWithArgs [inlined]: /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/std/start.zig:587:20
main: /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/std/start.zig:602:28
1 reference(s) hidden; use '-freference-trace=5' to see all referencesMust fail at runtime with:
NOT_CONTAINS output_emitted.zig
CONTAINS KORU021
CONTAINS has no branch 'missing'Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (bits: 8)
Test Configuration
MUST_ERROR