✓
Passing This code compiles and runs correctly.
Code
// Test: ~for deeply nested in continuation hierarchy
//
// This tests the case where ~for is several levels deep in nested continuations,
// like in the nbody benchmark:
// | result1 |> event1() | done |> event2() | result2 |> for(...) | each |> ...
//
// The transform must search RECURSIVELY through nested continuations.
~import std/io
~import std/control
const std = @import("std");
// Event chain to create deep nesting
~event step1 {}
~proc step1|zig {
}
~event step2 {}
~proc step2|zig {
}
// Main flow: for is nested 2 levels deep
~step1()
~step2()
~for(0..3)
! each _ |> std/io:print.ln("iteration")
| done |> std/io:print.ln("done")
Actual
iteration
iteration
iteration
done
Expected output
iteration
iteration
iteration
done
Test Configuration
MUST_RUN