2019-07-27 00:54:25 +03:00
|
|
|
// run-pass
|
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
fn ho<F>(f: F) -> isize where F: FnOnce(isize) -> isize { let n: isize = f(3); return n; }
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
fn direct(x: isize) -> isize { return x + 1; }
|
2010-06-23 21:03:09 -07:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2015-03-25 17:06:52 -07:00
|
|
|
let a: isize = direct(3); // direct
|
|
|
|
let b: isize = ho(direct); // indirect unbound
|
2011-07-27 14:19:39 +02:00
|
|
|
|
2013-05-18 22:02:45 -04:00
|
|
|
assert_eq!(a, b);
|
2011-08-19 15:16:48 -07:00
|
|
|
}
|