✓
Passing This code compiles and runs correctly.
Code
// BUG: print.ln inline code ordering in nested for loop with void events
//
// REPRODUCTION: Matches the nbody pattern exactly:
// - for loop with void events in | each |
// - branched event in | done |
// - print.ln using the branch binding
const std = @import("std");
~import std/control
~import std/io
// Void event (like advance-velocities)
~tor step-one {}
~proc step-one|zig {}
// Another void event (like advance-positions)
~tor step-two {}
~proc step-two|zig {}
// Branched event (like calculate-energy)
~tor get-result {} -> i32
~proc get-result|zig {
return 42;
}
// Print event with a result (like print-energy)
~tor print-value { v: i32 }
~proc print-value|zig {
std.debug.print("{d}\n", .{v});
}
// Initial setup (like initialize-bodies)
~tor setup {} -> i32
~proc setup|zig {
return 1;
}
// Main flow - matches nbody structure
~setup(): _ |> get-result(): v1 |> print-value(v: v1) |> for(0..3)
! each _ |> step-one() |> step-two()
| done |> get-result(): v2 |> std/io:print.ln("Result: {{ v2:d }}")
Actual
42
Result: 42
Flows
flow ~setup click a branch to expand · @labels scroll to their anchor
setup
Test Configuration
MUST_RUN