✗
Failing This test is currently failing.
Failed: backend-exec
Error Details
transform pass failed (TransformPreambleAtNestedSite). The pipeline cannot continue with a partially-transformed AST. Panic: transform pass failed — see error above
Failure Output
Showing last 10 of 66 lines
^
/Users/larsde/src/koru/tests/regression/670_NESTING_SWEEP/670_014_capture_under_for_each/backend.zig:190:51: 0x1025379ef in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^
/opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/std/start.zig:627:37: 0x10253d6ab in main (backend)
const result = root.main() catch |err| {
^
???:?:?: 0x18da2fdff in ??? (???)
???:?:?: 0x0 in ??? (???)
/Users/larsde/src/koru/scripts/regression_lib.sh: line 256: 25229 Abort trap: 6 ./backend output Code
// NESTING SWEEP — capture under POSITION 4: for-each branch.
// capture fold (increments a counter once) nested under the `! each _` body of
// a for-loop over 0..3. The fresh-per-fire fold fires 3 times, each producing
// `n=1` — deterministic output (3 identical lines). `| done` is the terminal.
import std/io
for(0..3)
! each _ |> capture { n: 0[i64] }
! as acc |> captured { n: acc.n + 1 }
| captured r |> std/io:print.ln("n={{ r.n:d }}")
| done |> _
Expected output
n=1
n=1
n=1
Test Configuration
MUST_RUN