rust/src/test/run-pass/block-fn-coerce.rs
2012-01-23 19:06:33 -08:00

8 lines
166 B
Rust

fn force(f: fn() -> int) -> int { ret f(); }
fn main() {
fn f() -> int { ret 7; }
assert (force(f) == 7);
let g = bind force(f);
assert (g() == 7);
}