✓
Passing Passing: the compiler rejects this program as expected.
Code
// RULING 1 (KORU037) under a transform head — the sibling of 220_018.
//
// A no-op `_` body on an OPTIONAL effect branch is illegal even when the arm
// rides a comptime transform: `run` borrows `step`'s arm vocabulary (it
// forwards `!` arms onto a generated `step` call — the `vaxis:run` shape), so
// the transform-flow exemption must not swallow the ban. `tick` is optional
// on `step`, resolvable within the invoked decl's own module.
~pub tor step {}
! ?tick i64
| ?done
~proc step|zig { return .{ .done = .{} }; }
~[comptime|transform]pub tor run { expr: Expression, item: *const std/compiler:Item, program: *const std/compiler:Program } -> SiteResult
~proc run|zig {
const ast = @import("ast");
const allocator = @import("std").heap.page_allocator;
const flow = if (item.* == .flow) &item.flow else return .{};
return .{ .replacement = ast.Item{ .inline_code = .{ .code = "// run ran", .location = flow.location, .module = allocator.dupe(u8, flow.module) catch return .{} } } };
}
~run()
! tick _ |> _
Actual compiler output
error[KORU037]: no-op `_` body on optional effect branch 'tick' — subscribing to an optional effect only to do nothing is pure noise
--> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_043_transform_optional_noop_arm_banned/input.kz:25:0
|
25 | ! tick _ |> _
| ^
hint: omit the handler entirely. A no-op is also a hazard: if 'tick' is later promoted to REQUIRED, this handler would silently swallow the event instead of surfacing the must-handle error. To act, replace `_` with a real step; to intentionally handle-and-ignore, the branch must be REQUIRED (drop the `?`), not optional.Must fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
KORU037Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_ERROR