✓
Passing Passing: the compiler rejects this program as expected.
Code
// `| ok i64 = 5` — a `= <expr>` tail on an identity payload is a field
// default with no field; it reaches the emitted union as enum-value
// syntax and dies in the backend.
const std = @import("std");
~pub tor poll {}
| ok i64 = 5
| done
~proc poll|zig { return .{ .done = .{} }; }
~poll()
| ok _ |> _
| done |> _
Actual compiler output
error[PARSE011]: identity branch 'ok' carries a default — `= <expr>` only applies to tor input fields; the emitted union drops it
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_266_identity_branch_default_refused/input.kz:7:1
|
7 | | ok i64 = 5
| ^
hint: drop the `= <expr>` — every constructor supplies the payload explicitly. For an omittable input, put the default on the tor's input shape insteadFrontend must reject with:
CONTAINS error[PARSE011]
CONTAINS identity branch 'ok'
ERROR_AT 7Flows
flow ~poll click a branch to expand · @labels scroll to their anchor
poll
Test Configuration
MUST_ERROR