2011-10-20 22:34:04 -05:00
|
|
|
fn f(i: int, &called: bool) {
|
2011-10-10 16:03:25 -05:00
|
|
|
assert i == 10;
|
|
|
|
called = true;
|
|
|
|
}
|
|
|
|
|
2012-01-11 11:58:05 -06:00
|
|
|
fn g(f: native fn(int, &bool), &called: bool) {
|
2011-10-10 16:03:25 -05:00
|
|
|
f(10, called);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-03-22 10:39:41 -05:00
|
|
|
let mut called = false;
|
2011-10-10 16:03:25 -05:00
|
|
|
let h = f;
|
|
|
|
g(h, called);
|
|
|
|
assert called == true;
|
|
|
|
}
|