14 lines
231 B
Rust
14 lines
231 B
Rust
|
|
||
|
fn compute1() -> float {
|
||
|
let v = [0f, 1f, 2f, 3f];
|
||
|
|
||
|
vec::foldl(0f, v) { |x, y| x + y } - 10f
|
||
|
//!^ ERROR mismatched types: expected `()`
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let x = compute1();
|
||
|
log(debug, x);
|
||
|
assert(y == -4f);
|
||
|
}
|