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

8 lines
176 B
Rust
Raw Normal View History

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