add test for commit 9502fb99e0
This commit is contained in:
parent
9502fb99e0
commit
7cc0f554ae
1 changed files with 22 additions and 0 deletions
22
src/test/run-pass/monomorphize-iface-in-fn-at.rs
Normal file
22
src/test/run-pass/monomorphize-iface-in-fn-at.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// 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()
|
||||
}
|
||||
|
||||
iface ty_ops {
|
||||
fn mk() -> uint;
|
||||
}
|
||||
|
||||
impl of ty_ops for () {
|
||||
fn mk() -> uint { 22u }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let fn_env = fn@() -> uint {
|
||||
mk_nil(())
|
||||
};
|
||||
assert fn_env() == 22u;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue