rust/src/test/run-pass/fun-call-variants.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

14 lines
319 B
Rust

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