rust/src/test/run-pass/fun-call-variants.rs

19 lines
402 B
Rust
Raw Normal View History

2010-06-23 23:03:09 -05:00
// -*- rust -*-
fn ho(fn(int) -> int f) -> int { let int n = f(3); ret n; }
fn direct(int x) -> int { ret x + 1; }
2010-06-23 23:03:09 -05:00
fn main() {
let int a =
direct(3); // direct
//let int b = ho(direct); // indirect unbound
let int c =
ho(bind direct(_)); // indirect bound
//assert (a == b);
//assert (b == c);
2010-06-23 23:03:09 -05:00
}