Add a test for higher-order bare functions

Issue #1022
This commit is contained in:
Brian Anderson 2011-10-10 14:03:25 -07:00
parent 145feb3298
commit 84e98f4f65

View File

@ -0,0 +1,15 @@
fn# f(i: int, &called: bool) {
assert i == 10;
called = true;
}
fn# g(f: fn#(int, &bool), &called: bool) {
f(10, called);
}
fn main() {
let called = false;
let h = f;
g(h, called);
assert called == true;
}