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.
Связанное правило · Explicit type arguments are not allowed here →Действия
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.
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
Ссылкаfunction identity(value: int) -> int { value }let result = identity<int>(1)
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения check. Ненулевой код завершения.
diagnostic-tpz5512 at
example.tpz:2:14
Repaired program
Ссылкаfunction identity(value: int) -> int { value }let result = identity(1)
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.