✓
Passing This code compiles and runs correctly.
Code
// PIN: the frontend (koruc, src/main.zig generateTransformHandlersToEmitter)
// collected transform handlers into a FIXED [16]TransformEvent array and
// silently stopped wiring at `transform_count < 16` — no error, no warning.
// A handful of always-present implicit transforms (capture/assert/test/...)
// eat ~3 slots, so a program with ~14+ user transforms silently lost handlers.
// A dropped handler leaves its invocation un-transformed, so the event's
// `transformed` branch can't be satisfied -> KORU022 at the call site, even
// though every transform here is correctly defined.
//
// There is NO legitimate reason to cap the NUMBER of distinct transforms; the
// only principled guard against runaway transformation is the fixpoint
// circuit-breaker (transform_pass_runner.zig MAX_ITERATIONS = 1000), which
// catches a transform that never reaches a fixpoint. This test exercises 20
// distinct transforms (well over the old 16-handler ceiling): it must compile
// and run clean once the array becomes an unbounded ArrayList.
//
// Each transform replaces its invocation with a comment (no output); success
// is a clean compile + run with empty output (same shape as 700_002).
~[comptime|transform]pub event t1.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t1.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t1 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t2.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t2.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t2 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t3.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t3.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t3 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t4.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t4.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t4 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t5.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t5.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t5 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t6.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t6.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t6 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t7.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t7.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t7 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t8.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t8.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t8 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t9.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t9.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t9 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t10.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t10.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t10 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t11.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t11.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t11 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t12.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t12.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t12 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t13.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t13.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t13 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t14.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t14.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t14 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t15.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t15.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t15 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t16.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t16.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t16 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t17.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t17.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t17 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t18.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t18.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t18 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t19.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t19.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t19 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
~[comptime|transform]pub event t20.* { expr: Expression, item: *const Item, program: *const Program }
| transformed SiteResult
~proc t20.*|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{ .transformed = .{} };
return .{ .transformed = .{ .replacement = ast.Item{ .inline_code = .{ .code = "// t20 ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{ .transformed = .{} } } } } };
}
// Invoke all 20 — each must find its wired handler.
~t1.fire("x")
~t2.fire("x")
~t3.fire("x")
~t4.fire("x")
~t5.fire("x")
~t6.fire("x")
~t7.fire("x")
~t8.fire("x")
~t9.fire("x")
~t10.fire("x")
~t11.fire("x")
~t12.fire("x")
~t13.fire("x")
~t14.fire("x")
~t15.fire("x")
~t16.fire("x")
~t17.fire("x")
~t18.fire("x")
~t19.fire("x")
~t20.fire("x")
Flows
flow ~t1.fire click a branch to expand · @labels scroll to their anchor
t1.fire ("x")
flow ~t2.fire click a branch to expand · @labels scroll to their anchor
t2.fire ("x")
flow ~t3.fire click a branch to expand · @labels scroll to their anchor
t3.fire ("x")
flow ~t4.fire click a branch to expand · @labels scroll to their anchor
t4.fire ("x")
flow ~t5.fire click a branch to expand · @labels scroll to their anchor
t5.fire ("x")
flow ~t6.fire click a branch to expand · @labels scroll to their anchor
t6.fire ("x")
flow ~t7.fire click a branch to expand · @labels scroll to their anchor
t7.fire ("x")
flow ~t8.fire click a branch to expand · @labels scroll to their anchor
t8.fire ("x")
flow ~t9.fire click a branch to expand · @labels scroll to their anchor
t9.fire ("x")
flow ~t10.fire click a branch to expand · @labels scroll to their anchor
t10.fire ("x")
flow ~t11.fire click a branch to expand · @labels scroll to their anchor
t11.fire ("x")
flow ~t12.fire click a branch to expand · @labels scroll to their anchor
t12.fire ("x")
flow ~t13.fire click a branch to expand · @labels scroll to their anchor
t13.fire ("x")
flow ~t14.fire click a branch to expand · @labels scroll to their anchor
t14.fire ("x")
flow ~t15.fire click a branch to expand · @labels scroll to their anchor
t15.fire ("x")
flow ~t16.fire click a branch to expand · @labels scroll to their anchor
t16.fire ("x")
flow ~t17.fire click a branch to expand · @labels scroll to their anchor
t17.fire ("x")
flow ~t18.fire click a branch to expand · @labels scroll to their anchor
t18.fire ("x")
flow ~t19.fire click a branch to expand · @labels scroll to their anchor
t19.fire ("x")
flow ~t20.fire click a branch to expand · @labels scroll to their anchor
t20.fire ("x")
Test Configuration
MUST_RUN