✓
Passing Passing: the compiler rejects this program as expected.
Code
// A `= <expr>` default on a branch payload field is silently dropped:
// payload shapes emit as union-variant structs and only Input structs
// carry Zig field defaults. A constructor omitting the field then dies
// in the backend on `missing struct field` despite the declared default.
const std = @import("std");
~pub tor poll {}
| next { v: i64 = 5, w: i64 }
| done
~proc poll|zig { return .{ .done = .{} }; }
~poll()
| next _ |> _
| done |> _
Actual compiler output
error[PARSE011]: branch payload field 'v' carries a default — `= <expr>` only applies to tor input fields; the emitted union drops it
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_265_branch_payload_field_default_refused/input.kz:8:5
|
8 | | next { v: i64 = 5, w: i64 }
| ^
hint: drop the `= <expr>` — every constructor supplies the field explicitly. For an omittable input, put the default on the tor's input shape insteadFrontend must reject with:
CONTAINS error[PARSE011]
CONTAINS payload field 'v'
ERROR_AT 8Flows
flow ~poll click a branch to expand · @labels scroll to their anchor
poll
Test Configuration
MUST_ERROR