rust/src/test/run-pass/issue-2633.rs
2012-09-07 14:02:33 -07:00

22 lines
363 B
Rust

struct cat {
mut meow: fn@(),
}
fn cat() -> cat {
cat {
meow: fn@() { error!("meow"); }
}
}
type kitty_info = {kitty: cat};
// Code compiles and runs successfully if we add a + before the first arg
fn nyan(kitty: cat, _kitty_info: kitty_info) {
kitty.meow();
}
fn main() {
let mut kitty = cat();
nyan(kitty, {kitty: kitty});
}