-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Description
Example code:
use std::iter::AdditiveIterator;
fn main() {
let x: [u64, ..3] = [1, 2, 3];
println!("{}", range(0, 3).map(|i| x[i]).sum());
}
In this case, the type of the integers for the range
is unambiguously uint
, although the compiler still throws an error and won't accept the code unless you add a u
suffix to either the 0
or the 3
in the range
. This seems to apply to all types of iterators as well, and the compiler isn't good enough to infer the type based upon a later function call in the chain.
Metadata
Metadata
Assignees
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.