Skip to content

Commit 7cc0f55

Browse files
committed
add test for commit 9502fb9
1 parent 9502fb9 commit 7cc0f55

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// test that invoking functions which require
2+
// dictionaries from inside an fn@ works
3+
// (at one point, it didn't)
4+
5+
fn mk_nil<C:ty_ops>(cx: C) -> uint {
6+
cx.mk()
7+
}
8+
9+
iface ty_ops {
10+
fn mk() -> uint;
11+
}
12+
13+
impl of ty_ops for () {
14+
fn mk() -> uint { 22u }
15+
}
16+
17+
fn main() {
18+
let fn_env = fn@() -> uint {
19+
mk_nil(())
20+
};
21+
assert fn_env() == 22u;
22+
}

0 commit comments

Comments
 (0)