2011-06-15 13:19:50 -05:00
|
|
|
// -*- rust -*-
|
2012-08-01 19:30:05 -05:00
|
|
|
fn ho(f: fn@(int) -> int) -> int { let n: int = f(3); return n; }
|
2011-06-15 13:19:50 -05:00
|
|
|
|
2012-08-01 19:30:05 -05:00
|
|
|
fn direct(x: int) -> int { return x + 1; }
|
2010-06-23 23:03:09 -05:00
|
|
|
|
|
|
|
fn main() {
|
2011-08-19 17:16:48 -05:00
|
|
|
let a: int = direct(3); // direct
|
2011-08-18 23:27:22 -05:00
|
|
|
let b: int = ho(direct); // indirect unbound
|
2011-07-27 07:19:39 -05:00
|
|
|
|
2011-08-18 23:27:22 -05:00
|
|
|
assert (a == b);
|
2011-08-19 17:16:48 -05:00
|
|
|
}
|