2012-01-04 16:16:41 -06:00
|
|
|
|
|
|
|
fn compute1() -> float {
|
2012-06-25 22:00:46 -05:00
|
|
|
let v = [0f, 1f, 2f, 3f]/~;
|
2012-01-04 16:16:41 -06:00
|
|
|
|
|
|
|
vec::foldl(0f, v) { |x, y| x + y } - 10f
|
2012-06-30 06:23:59 -05:00
|
|
|
//~^ ERROR mismatched types: expected `()`
|
2012-01-04 16:16:41 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = compute1();
|
|
|
|
log(debug, x);
|
2012-01-04 18:04:37 -06:00
|
|
|
assert(x == -4f);
|
2012-01-04 16:16:41 -06:00
|
|
|
}
|