2011-04-07 15:49:27 -05:00
|
|
|
|
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
fn main() {
|
|
|
|
obj foo() {
|
2011-07-27 07:19:39 -05:00
|
|
|
fn m1(i: int) -> int { i += 1; ret i; }
|
|
|
|
fn m2(i: int) -> int { ret self.m1(i); }
|
|
|
|
fn m3(i: int) -> int { i += 1; ret self.m1(i); }
|
2011-06-15 13:19:50 -05:00
|
|
|
}
|
2011-07-27 07:19:39 -05:00
|
|
|
let a = foo();
|
|
|
|
let i: int = 0;
|
2011-06-15 13:19:50 -05:00
|
|
|
i = a.m1(i);
|
|
|
|
assert (i == 1);
|
|
|
|
i = a.m2(i);
|
|
|
|
assert (i == 2);
|
|
|
|
i = a.m3(i);
|
|
|
|
assert (i == 4);
|
|
|
|
}
|