✓
Passing This code compiles and runs correctly.
Code
// Test: [keyword] on private event should error
// [keyword] requires pub because private events can't be imported
~[keyword] event private-thing {}
~proc private-thing|zig {
// This should never run - the error is at parse time
}
Frontend must reject with:
[keyword] annotation requires 'pub'Expected compiler error
error[PARSE003]: [keyword] annotation requires 'pub' - only public events can be keywords
--> tests/regression/300_ADVANCED_FEATURES/330_KEYWORD/330_004_keyword_requires_pub/input.kz:3:1
|
3 |
| ^
Error Verification
Expected Error Pattern
[keyword] on private event should produce compile errorActual Compiler Output
error[PARSE003]: [keyword] annotation requires 'pub' - only public events can be keywords
--> tests/regression/300_ADVANCED_FEATURES/330_KEYWORD/330_004_keyword_requires_pub/input.kz:3:1
|
3 |
| ^Test Configuration
MUST_FAIL