Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Диагностика TPZ5005

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

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

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

    Правилоdiagnostics.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.

    Response

    Ссылка

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

    Reproduction and verification

    Ссылка

    Rejected program

    Ссылка
    example.tpzRejected programОткрыть песочницу →
    1. let value = 1
    2. value()
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения check. Ненулевой код завершения.

    Repaired program

    Ссылка
    example.tpzRepaired program
    1. function value() -> int { 1 }
    2. value()
    Ожидаемый выводКод завершения 0
    $ topaz check example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Проверка принимает программу. Код завершения 0.

    Меню

    Загрузка →