✓
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 tor greet { name: string } -> string
// This should cause a compiler error - pub is not valid on procs
~pub proc greet {
return "Hello!";
}
Frontend must reject with:
CONTAINS error[PARSE003
CONTAINS not valid on proc declarationsExpected compiler error
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:8:1
|
8 | ~pub proc greet {
| ^