✓
Passing This code compiles and runs correctly.
Code
// Test: ~pub proc should be rejected
// Only events can be pub, procs cannot.
// Procs are implementation details - they follow their event's visibility.
~pub event greet { name: []const u8 }
| greeted { message: []const u8 }
// This should cause a compiler error - pub is not valid on procs
~pub proc greet {
return .{ .greeted = .{ .message = "Hello!" } };
}
Error Verification
Expected Error Pattern
pub is not valid on proc declarations - only events can be publicActual Compiler Output
error[PARSE003]: 'pub' is not valid on proc declarations - only events can be public
--> tests/regression/000_CORE_LANGUAGE/020_EVENTS_FLOWS/020_012_reject_pub_proc/input.kz:10:1
|
10 | ~pub proc greet {
| ^Test Configuration
MUST_FAIL
Expected Behavior:
FRONTEND_COMPILE_ERROR