S0112: cannot infer type argument
Generated from rellum-diagnostics/src/db.rs.
Explanation
Call-site generic inference is local. Each type parameter must appear in an argument position or be supplied explicitly; otherwise the compiler has no concrete type to use for monomorphization.
Common causes
- a generic type parameter appears only in the return type
- calling a generic function with too little type information
- passing an empty literal whose element type is ambiguous
Canonical fixes
- provide explicit type arguments
Before:
make_empty()
After:
make_empty[Int]()
- add an argument or annotation that carries the missing type
Code example
make_empty()