✓
Passing This code compiles and runs correctly.
Code
// Test: Parser should reject single-field braces in branch payloads
// Single field in braces should use identity syntax instead
const std = @import("std");
// WRONG: Single field in braces
// Should be: | ok i32 (identity syntax)
~event compute {}
| ok { value: i32 }
Must fail at frontend compile:
Parsing or type-checking must reject the program.
Expected compiler error
error[PARSE003]: single field in braces - use identity syntax '| ok i32' instead of '| ok { value: i32 }'
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_063_reject_single_field_braces/input.kz:9:4
|
9 | | ok { value: i32 }
| ^
Test Configuration
Expected Error:
single field