rust/src/test/run-pass/fun-call-variants.rs
2012-08-01 19:16:06 -07:00

12 lines
250 B
Rust

// -*- rust -*-
fn ho(f: fn@(int) -> int) -> int { let n: int = f(3); return n; }
fn direct(x: int) -> int { return x + 1; }
fn main() {
let a: int = direct(3); // direct
let b: int = ho(direct); // indirect unbound
assert (a == b);
}