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