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()
표준 출력 없음.기대 결과
Repaired program
링크function value() -> int { 1 }value()
기대 결과
기대 결과
검사가 프로그램을 받아들입니다. 종료 코드 0.