Diagnostic and cause
LinkExplicit type arguments are not allowed here
- Family
- topaz
- Phase
- check
- Code
TPZ5512
Cause and conditions
A call with no permitted type parameters rejects a nonempty explicit type-argument list with TPZ5512.
Related rule: Explicit type arguments are not allowed hereResponse
Remove the type-argument list. Check the declaration before using explicit specialization syntax.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 798-807 - compiler/crates/topaz_self_frontend/topaz/checker/call_plan.tpz at
151141d7bb44· 1182-1182 - compiler/crates/topaz_self_frontend/topaz/checker/call_plan.tpz at
151141d7bb44· 1170-1186
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.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/checker/call_plan.tpz at
151141d7bb44· 1170-1186
Response
LinkRemove the type-argument list. Check the declaration before using explicit specialization syntax.
Reproduction and verification
LinkRejected program
Linkfunction identity(value: int) -> int { value }let result = identity<int>(1)
No stdout.
Expected result
Source evidence
- compiler/crates/topaz_self_frontend/topaz/checker/call_plan.tpz at
151141d7bb44· 1170-1186
Repaired program
Linkfunction identity(value: int) -> int { value }let result = identity(1)
Expected result
Expected result
Checking accepts the program. Exit code 0.
Source evidence
- compiler/crates/topaz_self_frontend/topaz/checker/call_plan.tpz at
151141d7bb44· 1170-1186