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;
|
|
|
|
}
|
|
|
|
|
2011-10-20 22:34:04 -05:00
|
|
|
fn g(f: fn(int, &bool), &called: bool) {
|
2011-10-10 16:03:25 -05:00
|
|
|
f(10, called);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let called = false;
|
|
|
|
let h = f;
|
|
|
|
g(h, called);
|
|
|
|
assert called == true;
|
|
|
|
}
|