✗
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_012_capture_under_obligation/backend.zig:190:51: 0x102f0f9ef 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: 0x102f156ab in main (backend)
const result = root.main() catch |err| {
^
???:?:?: 0x18da2fdff in ??? (???)
???:?:?: 0x0 in ??? (???)
/Users/larsde/src/koru/scripts/regression_lib.sh: line 256: 25214 Abort trap: 6 ./backend output Code
// NESTING SWEEP — capture under POSITION 2: obligation branch.
// capture fold (increments a counter once) nested under `| ok s` from
// from-page, which carries a String<view!> cleanup obligation. The view `s`
// must be freed on EVERY terminal of the nested construct (here the single
// `| captured r` terminal) or KORU030 fires.
import std/io
import std/string
std/string:from-page("x")
| ok s |> capture { n: 0[i64] }
! as acc |> captured { n: acc.n + 1 }
| captured r |> std/io:print.ln("n={{ r.n:d }}") |> std/string:free(s)
| err _ |> std/io:print.ln("err")
Expected output
n=1
Test Configuration
MUST_RUN