rust/src/test/run-pass/bind-interior.rs

12 lines
147 B
Rust
Raw Normal View History

2011-01-06 14:56:30 -06:00
// -*- rust -*-
2011-07-27 07:19:39 -05:00
fn f(n: int) -> int { ret n; }
2011-01-06 14:56:30 -06:00
fn main() {
let g: fn@() -> int = bind f(10);
2011-07-27 07:19:39 -05:00
let i: int = g();
assert (i == 10);
}