Diagnostic and cause
LinkValue is not callable
- Family
- topaz
- Phase
- check
- Code
TPZ5005
Cause and conditions
The expression before call parentheses must be callable. Calling an int binding is rejected with TPZ5005 at that binding reference.
Related rule: Call parentheses require a callable valueResponse
Call a function or method that performs the operation. Remove the parentheses when the value itself is wanted.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 629-641 - compiler/crates/topaz_product_runtime/src/diagnostic.rs at
151141d7bb44· 66-66 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
151141d7bb44· 1328-1328 - compiler/crates/topaz_self_frontend/topaz/checker/expression_control.tpz at
151141d7bb44· 1182-1182 - compiler/crates/topaz_self_frontend/topaz/checker/statements.tpz at
151141d7bb44· 439-443 - compiler/crates/topaz_self_frontend/topaz/checker/statements.tpz at
151141d7bb44· 505-505 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
151141d7bb44· 1319-1342
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.
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.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/checker/statements.tpz at
151141d7bb44· 439-443 - compiler/crates/topaz_self_frontend/topaz/checker/statements.tpz at
151141d7bb44· 505-505 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
151141d7bb44· 1319-1342
Response
LinkCall a function or method that performs the operation. Remove the parentheses when the value itself is wanted.
Reproduction and verification
LinkRejected program
Linklet value = 1value()
No stdout.
Expected result
Source evidence
- compiler/crates/topaz_self_frontend/topaz/checker/statements.tpz at
151141d7bb44· 439-443 - compiler/crates/topaz_self_frontend/topaz/checker/statements.tpz at
151141d7bb44· 505-505 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
151141d7bb44· 1319-1342
Repaired program
Linkfunction value() -> int { 1 }value()
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/checker/statements.tpz at
151141d7bb44· 439-443 - compiler/crates/topaz_self_frontend/topaz/checker/statements.tpz at
151141d7bb44· 505-505 - compiler/crates/topaz_self_frontend/topaz/checker/call_complete.tpz at
151141d7bb44· 1319-1342