012 nested router

✗ Failing This test is currently failing.

Failed: backend-exec

Failure Output

Showing last 10 of 13 lines
    if (std.mem.eql(u8, (&req1).method, "GET") and std.mem.eql(u8, (&req1).path, "/other")) {
        (struct { fn __kout(__fd: i32, __b: []const u8) void { if (@import("builtin").os.tag == .freestanding) { const __kc = struct { extern var stdout: ?*anyopaque; extern var stderr: ?*anyopaque; extern fn fputs(__s: [*:0]const u8, __st: ?*anyopaque) c_int; }; var __kt: [4096]u8 = undefined; var __ki: usize = 0; while (__ki < __b.len) { const __kn = @min(__kt.len - 1, __b.len - __ki); @memcpy(__kt[0..__kn], __b[__ki..][0..__kn]); __kt[__kn] = 0; @import("std").mem.doNotOptimizeAway(__kc.fputs(@as([*:0]const u8, @ptrCast(&__kt)), if (__fd == 2) __kc.stderr else __kc.stdout)); __ki += __kn; } } else { @import("std").mem.doNotOptimizeAway(@import("std").posix.write(__fd, __b) catch @as(usize, 0)); } } fn __kw(comptime __f: []const u8, __a: anytype) void { var __kb: [65536]u8 = undefined; const __ks = @import("std").fmt.bufPrint(&__kb, __f, __a) catch __kb[0..0]; __kout(1, __ks); } }).__kw("inner: /other\n", .{});
    } else {
        (struct { fn __kout(__fd: i32, __b: []const u8) void { if (@import("builtin").os.tag == .freestanding) { const __kc = struct { extern var stdout: ?*anyopaque; extern var stderr: ?*anyopaque; extern fn fputs(__s: [*:0]const u8, __st: ?*anyopaque) c_int; }; var __kt: [4096]u8 = undefined; var __ki: usize = 0; while (__ki < __b.len) { const __kn = @min(__kt.len - 1, __b.len - __ki); @memcpy(__kt[0..__kn], __b[__ki..][0..__kn]); __kt[__kn] = 0; @import("std").mem.doNotOptimizeAway(__kc.fputs(@as([*:0]const u8, @ptrCast(&__kt)), if (__fd == 2) __kc.stderr else __kc.stdout)); __ki += __kn; } } else { @import("std").mem.doNotOptimizeAway(@import("std").posix.write(__fd, __b) catch @as(usize, 0)); } } fn __kw(comptime __f: []const u8, __a: anytype) void { var __kb: [65536]u8 = undefined; const __ks = @import("std").fmt.bufPrint(&__kb, __f, __a) catch __kb[0..0]; __kout(1, __ks); } }).__kw("inner: catch-all\n", .{});
    }

error[KORU124]: transform 'router' invoked in continuation position is not supported here
  --> tests/regression/300_ADVANCED_FEATURES/350_SUBFLOWS/350_012_nested_router/input.kz:29:0
  this transform uses the whole-program escape, which matches flow-root invocations only; a continuation-position invocation is never rewritten (frontier: 210_024_source_scope_capture).
  fix: invoke 'router' at top level, or have it return a site-local SiteResult instead of a whole_program.

Code

input.kz

Expected output

outer: /api/health
inner: /other
inner: catch-all

Flows

flow ~router click a branch to expand · @labels scroll to their anchor
router (req: &req1)
flow ~router click a branch to expand · @labels scroll to their anchor
router (req: &req2)
flow ~router click a branch to expand · @labels scroll to their anchor
router (req: &req3)

Test Configuration

MUST_RUN