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

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

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

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

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

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

    The callee is not a generic function/static member that accepts explicit type arguments.

    Diagnostic and cause

    Ссылка

    Explicit type arguments are not allowed here

    Семейство
    topaz
    Этап
    check
    Код
    TPZ5512

    Причина и условия

    A call with no permitted type parameters rejects a nonempty explicit type-argument list with TPZ5512.

    Действия

    Remove the type-argument list. Check the declaration before using explicit specialization syntax.

    Compiler phase: check.

    Compiler explanation: The callee is not a generic function/static member that accepts explicit type arguments.

    Message templates. The marker ⟨value⟩ stands for text computed for the reported program.

    • this call is not generic, but ⟨value⟩ type argument⟨value⟩ ⟨value⟩ supplied Source

    Observed for the candidate in Topaz 5.21.3. Execution

    • error[TPZ5512]: this call is not generic, but 1 type argument was supplied

    A call with no permitted type parameters rejects a nonempty explicit type-argument list with TPZ5512.

    Правилоdiagnostics.tpz5512.p5.rule

    Explicit type arguments are not allowed here

    A call with no permitted type parameters rejects a nonempty explicit type-argument list with TPZ5512.

    Response

    Ссылка

    Remove the type-argument list. Check the declaration before using explicit specialization syntax.

    Reproduction and verification

    Ссылка

    Rejected program

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

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

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

    Repaired program

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

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

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

    Меню

    Загрузка →