Closed
Description
The following code fails to compile:
#![feature(default_type_params)]
fn foo<T = u64>(t: T) {}
fn main() {
foo(0);
}
with
error: cannot determine a type for this expression: cannot determine the type of this integer; add a suffix to specify the type explicitly
despite the fact that the actual type is determinant.
Fixing this problem could help mitigate problems with the int
fallback: for functions like range
, we could provide a default type parameter of, say, uint
while retaining flexibility for other types. (Doing so loses some of the benefit of the fallback removal, but we can introduce defaults in a controlled way.)