2012-01-04 16:16:41 -06:00
|
|
|
|
|
|
|
fn compute1() -> float {
|
2012-06-29 18:26:56 -05:00
|
|
|
let v = ~[0f, 1f, 2f, 3f];
|
2012-01-04 16:16:41 -06:00
|
|
|
|
2012-09-28 00:20:47 -05:00
|
|
|
do vec::foldl(0f, v) |x, y| { x + *y } - 10f
|
2012-07-03 19:30:25 -05:00
|
|
|
//~^ ERROR mismatched types: expected `()`
|
2012-01-04 16:16:41 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = compute1();
|
|
|
|
log(debug, x);
|
2012-07-03 19:30:25 -05:00
|
|
|
assert(x == -4f);
|
2012-01-04 16:16:41 -06:00
|
|
|
}
|