S0002: parameter needs explicit type annotation
Generated from rellum-diagnostics/src/db.rs.
Explanation
Function parameters are part of a function's public type. Rellum does not infer those parameter types from the function body, so each parameter needs an annotation before the analyzer can type-check calls, imports, or generic instantiations.
Common causes
- writing a function parameter without
: Type - expecting the compiler to infer a parameter type from arithmetic or calls in the body
- omitting annotations on a generic function's parameters
Canonical fixes
- add an explicit parameter type
Before:
double(x) : Int = x * 2
After:
double(x: Int) : Int = x * 2
- annotate every parameter in a generic function
Before:
identity[T](x) : T = x
After:
identity[T](x: T) : T = x
Code example
double(x) : Int = x * 2