S0122: wrong number of type arguments for type
Generated from rellum-diagnostics/src/db.rs.
Explanation
Generic types declare a fixed number of type parameters. A type annotation or constructor instantiation must provide exactly that many type arguments.
Common causes
- providing too many type arguments to a generic record or enum
- providing too few type arguments
- adding type arguments after the type definition's arity changed
Canonical fixes
- provide exactly the declared type arguments
Before:
value: Pair[Int] = Pair { first: 1, second: 2 }
After:
value: Pair[Int, Int] = Pair { first: 1, second: 2 }
- check the type definition's parameter list and make the use match it
Code example
value: Pair[Int] = Pair { first: 1, second: 2 }