rust/src/test/run-pass/obj-self-2.rs
2011-07-27 15:54:33 +02:00

12 lines
193 B
Rust

fn main() {
obj foo() {
fn m1(i: int) { i += 1; log "hi!"; }
fn m2(i: int) { i += 1; self.m1(i); }
}
let a = foo();
let i: int = 0;
a.m1(i);
a.m2(i);
}