✓
Passing This code compiles and runs correctly.
Code
// Test 608: Event Taps with Label Jumps
// Validates that taps fire when continuations use label jumps (@label)
//
// BUG: Tap function __tap0 is generated but never called in label loops
// Expected: __tap0(v) should be invoked after .next branch binding
// Actual: Tap invocation is missing, so no output is produced
const std = @import("std");
~import std/taps
~event counter { n: i32 }
| next i32
| done i32
~proc counter|zig {
if (n < 3) {
return .{ .next = n + 1 };
}
return .{ .done = n };
}
~event log-iteration { value: i32 }
~proc log-iteration|zig {
std.debug.print("Iteration: {}\n", .{value});
}
// Tap that should fire on every counter -> * transition with 'next' branch
~tap(counter -> *)
| next v |> log-iteration(value: v)
// Recursive label using counter - tap should fire on each loop iteration
~event start {}
~proc start|zig {
}
~start() |> #loop counter(n: 1)
| next v |> @loop(n: v)
| done |> _
Actual
Iteration: 2
Iteration: 3
Expected output
Iteration: 2
Iteration: 3
Test Configuration
MUST_RUN