rust/src/test/run-pass/sendfn-is-a-block.rs
2012-01-23 19:06:33 -08:00

8 lines
148 B
Rust

fn test(f: fn(uint) -> uint) -> uint {
ret f(22u);
}
fn main() {
let y = test(fn~(x: uint) -> uint { ret 4u * x; });
assert y == 88u;
}