提交 431cb9a3 编写于 作者: L Lindsey Kuper

Test method overriding a little more.

上级 336949a5
......@@ -26,4 +26,21 @@ fn foo() -> int {
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);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册