✓
Passing Passing: the compiler rejects this program as expected.
Code
// RULING 1 (KORU054) under a transform head — the terminal half of 220_043.
//
// A no-op `_` body on an OPTIONAL terminal branch is illegal even when the
// arm rides a comptime transform: `run` borrows `step`'s arm vocabulary, so
// `done`'s optionality is declared on the sibling decl in the same 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()
| done _ |> _
Actual compiler output
error[KORU054]: no-op `_` body on optional terminal branch 'done' — arming an optional outcome only to discard it is pure noise
--> tests/regression/200_COMPILER_FEATURES/220_FLOW_CHECKER/220_045_transform_optional_terminal_noop_banned/input.kz:23:0
|
23 | | done _ |> _
| ^
hint: omit the arm entirely — an unarmed optional branch already discards the outcome. A no-op is also a hazard: if 'done' is later promoted to REQUIRED, this arm would silently swallow it 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
KORU054Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_ERROR