○
Planned This feature is planned but not yet implemented.
ASPIRATIONAL: pure-Koru comptime #loop (when-guarded labeled recursion) at compile time.
Failure Output
Showing last 10 of 11 lines
--> tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_091_aspire_comptime_loop/input.kz:21:0
❌ Compiler coordination error: Unknown event referenced
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_091_aspire_comptime_loop/backend.zig:94:13: 0x104adf063 in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_091_aspire_comptime_loop/backend.zig:190:28: 0x104adfd4f in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^ Code
const std = @import("std");
~[comptime] event tick { n: i64 }
| go i64
~proc tick|zig {
return .{ .go = n };
}
~[comptime] event report { v: i64 }
~proc report|zig {
std.debug.print("{}\n", .{v});
}
~[comptime] countdown = #loop tick(n: 5)
| go i when i > 0 |> @loop(n: i - 1)
| go i |> report(v: i)
~[comptime] countdown()
Expected output
0
Flows
subflow ~[comptime] countdown click a branch to expand · @labels scroll to their anchor
#loop tick (n: 5)
flow ~countdown click a branch to expand · @labels scroll to their anchor
countdown
Test Configuration
MUST_RUN