Diagnostic and cause
СсылкаValue is not callable
- Семейство
- topaz
- Этап
- check
- Код
TPZ5005
Причина и условия
The expression before call parentheses must be callable. Calling an int binding is rejected with TPZ5005 at that binding reference.
Связанное правило · Call parentheses require a callable value →Действия
Call a function or method that performs the operation. Remove the parentheses when the value itself is wanted.
Compiler phase: check/runtime.
Compiler explanation: A call expression targeted a value that is not a function, method, constructor, or callable builtin.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
⟨value⟩is not callable Source⟨value⟩is not callable Source⟨value⟩is not callable Source
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ5005]:
intis not callable
The expression before call parentheses must be callable. Calling an int binding is rejected with TPZ5005 at that binding reference.
Call parentheses require a callable value
The expression before call parentheses must be callable. Calling an int binding is rejected with TPZ5005 at that binding reference.
Response
СсылкаCall a function or method that performs the operation. Remove the parentheses when the value itself is wanted.
Reproduction and verification
СсылкаRejected program
Ссылкаlet value = 1value()
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения check. Ненулевой код завершения.
diagnostic-tpz5005 at
example.tpz:2:1
Repaired program
Ссылкаfunction value() -> int { 1 }value()
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.