✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// Test 210_066: Branch body must be inline after `|>` — trailing `|>` rejected
//
// The layout rules require a branch handler's body to be INLINE after `|>`:
// | ok x |> show(v: x)
// Dropping the body to the next line — a trailing `|>` with the body below —
// is the "`|> _` on a new line" anti-pattern and must be a FRONTEND parse error.
//
// ============================================================================
const std = @import("std");
~event get { id: usize }
| ok usize
~event show { v: usize }
~proc get|zig { return .{ .ok = id }; }
~proc show|zig { std.debug.print("{}\n", .{v}); }
// INVALID: body on the line AFTER `|>` instead of inline after it
~get(id: 1)
| ok x |>
show(v: x)
Must fail at frontend compile:
Parsing or type-checking must reject the program.
Test Configuration
Expected Error:
must follow '|>' on the same line