S0113: conflicting generic type inference
Generated from rellum-diagnostics/src/db.rs.
Explanation
A single type parameter must resolve to one concrete type for a given generic call. If different arguments imply different concrete types for the same parameter, the compiler cannot instantiate a coherent function body.
Common causes
- passing Int in one position and String in another for the same T
- using a generic Pair or array argument whose nested type disagrees
- expecting implicit conversion during generic inference
Canonical fixes
- make the arguments agree on one concrete type
Before:
same(1, "one")
After:
same(1, 2)
- use a function with separate type parameters when the arguments may differ
Code example
same(1, "one")