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

8 lines
166 B
Rust
Raw Normal View History

2012-01-23 16:59:00 -06:00
fn force(f: fn() -> int) -> int { ret f(); }
2011-07-25 18:57:27 -05:00
fn main() {
fn f() -> int { ret 7; }
2011-07-27 07:19:39 -05:00
assert (force(f) == 7);
let g = bind force(f);
assert (g() == 7);
}