Skip to content
Topaz6.0 · Before release
Download

Search documentation

Specification 6.0 · Not released · Tested product 5.21.3

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Diagnostics

    TPZ5005: Value is not callable

    A call expression targeted a value that is not a function, method, constructor, or callable builtin.

    Diagnostic and cause

    Link

    Value 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.

    Response

    Call a function or method that performs the operation. Remove the parentheses when the value itself is wanted.

    Source evidence

    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]: int is not callable

    The expression before call parentheses must be callable. Calling an int binding is rejected with TPZ5005 at that binding reference.

    Rulediagnostics.tpz5005.p5.rule

    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

    Response

    Link

    Call a function or method that performs the operation. Remove the parentheses when the value itself is wanted.

    Reproduction and verification

    Link

    Rejected program

    Link
    example.tpzRejected programOpen in Playground
    1. let value = 1
    2. value()
    Expected outputNonzero exit
    No stdout.
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Rejection during check. Nonzero exit.

    • TPZ5005 diagnostic-tpz5005 at example.tpz:2:1
    Source evidence

    Repaired program

    Link
    example.tpzRepaired program
    1. function value() -> int { 1 }
    2. value()
    Expected outputexit 0
    $ topaz check example.tpz · target product 5.21.3
    Expected result

    Expected result

    Checking accepts the program. Exit code 0.

    Source evidence

    Menu

    Download