2012-03-21 10:17:44 -05:00
|
|
|
// test that invoking functions which require
|
|
|
|
// dictionaries from inside an fn@ works
|
|
|
|
// (at one point, it didn't)
|
|
|
|
|
|
|
|
fn mk_nil<C:ty_ops>(cx: C) -> uint {
|
|
|
|
cx.mk()
|
|
|
|
}
|
|
|
|
|
2012-07-31 12:27:51 -05:00
|
|
|
trait ty_ops {
|
2012-03-21 10:17:44 -05:00
|
|
|
fn mk() -> uint;
|
|
|
|
}
|
|
|
|
|
2012-08-07 20:10:06 -05:00
|
|
|
impl (): ty_ops {
|
2012-03-21 10:17:44 -05:00
|
|
|
fn mk() -> uint { 22u }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let fn_env = fn@() -> uint {
|
|
|
|
mk_nil(())
|
|
|
|
};
|
|
|
|
assert fn_env() == 22u;
|
|
|
|
}
|