✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: a tor's declared name must be one a call site can spell. `evil(x)`
// reads the parenthesised tail into the name — registering a tor under
// "evil(x)" that `evil(x)` at a call site resolves to the bare `evil` —
// so the declaration would mint a tor nothing can call, and the caller
// would eat "unknown tor" for text it never wrote.
import std/io
tor evil(x) {}
Actual compiler output
error[PARSE003]: tor name 'evil(x)' is not one a call site can spell — each '.'-separated piece is an identifier (or '*' for a transform glob)
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_303_tor_name_with_call_tail_refused/input.k:8:6
|
8 | tor evil(x) {}
| ^Frontend must reject with:
CONTAINS error[PARSE003]
ERROR_AT 8
NOT_CONTAINS output_emitted.zigTest Configuration
MUST_ERROR