rust/src/test/run-pass/block-fn-coerce.rs

8 lines
177 B
Rust
Raw Normal View History

fn force(f: &block() -> int) -> int { ret f(); }
2011-07-25 18:57:27 -05:00
fn main() {
2011-07-27 07:19:39 -05:00
let f = fn () -> int { ret 7 };
assert (force(f) == 7);
let g = bind force(f);
assert (g() == 7);
}