blob: 53d7861be4f89741c950ff1e4869a92cf420b605 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
class cat {
let mut meow: fn@();
new() { self.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});
}
|