2012-08-15 18:46:55 -07:00
|
|
|
struct cat {
|
2012-06-15 17:32:59 -07:00
|
|
|
let mut meow: fn@();
|
2012-07-30 16:01:07 -07:00
|
|
|
new() { self.meow = fn@() { error!{"meow"}; };}
|
2012-06-15 17:32:59 -07: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 16:16:41 -07:00
|
|
|
}
|