Test method overriding a little more.

This commit is contained in:
Lindsey Kuper 2011-07-20 15:46:56 -07:00
parent 336949a590
commit 431cb9a345
1 changed files with 17 additions and 0 deletions

View File

@ -26,4 +26,21 @@ fn main() {
assert (my_b.foo() == 3);
assert (my_b.bar() == 3);
auto my_c = obj() {
fn baz(int x, int y) -> int {
ret x + y + self.foo();
}
with my_b
};
auto my_d = obj() {
fn baz(int x, int y) -> int {
ret x + y + self.foo();
}
with my_a
};
assert (my_c.baz(1, 2) == 6);
assert (my_d.baz(1, 2) == 5);
}