S0124: conflicting inferred type arguments for type
Generated from rellum-diagnostics/src/db.rs.
Explanation
Each generic type parameter must resolve to one concrete type for a single type instantiation. If different fields imply different concrete types for the same parameter, the compiler cannot choose a coherent layout.
Common causes
- providing fields that imply different types for the same generic parameter
- mixing Int and String values in fields tied to one T
- expecting implicit conversion during generic type inference
Canonical fixes
- make fields agree on one concrete type
Before:
value = Pair { first: 1, second: "x" }
After:
value = Pair { first: 1, second: 2 }
- change the type definition to use separate type parameters when fields may differ
Code example
value = Pair { first: 1, second: "x" }