rust/src/test/run-pass/obj-self-2.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

13 lines
194 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);
}