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

10 lines
192 B
Rust
Raw Normal View History

2011-07-25 16:57:27 -07:00
// xfail-stage0
fn force(&block() -> int f) -> int { ret f(); }
fn main() {
auto f = fn() -> int { ret 7 };
assert(force(f) == 7);
auto g = bind force(f);
assert(g() == 7);
}