2012-08-15 20:46:55 -05:00
|
|
|
struct cat {
|
2012-06-15 19:32:59 -05:00
|
|
|
let mut meow: fn@();
|
2012-09-05 17:58:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn cat() -> cat {
|
|
|
|
cat {
|
|
|
|
meow: fn@() { error!("meow"); }
|
|
|
|
}
|
2012-06-15 19:32:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
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});
|
2012-06-17 18:16:41 -05:00
|
|
|
}
|