Exercise self-calls and overriding together a bit more.
This commit is contained in:
parent
fefeebce24
commit
e71f261e3f
@ -22,4 +22,16 @@ fn main() {
|
||||
|
||||
assert (my_b.baz() == 2);
|
||||
|
||||
auto my_c = obj {
|
||||
fn foo() -> int {
|
||||
ret 3;
|
||||
}
|
||||
fn baz() -> int {
|
||||
ret self.foo();
|
||||
}
|
||||
with my_a
|
||||
};
|
||||
|
||||
assert (my_c.baz() == 3);
|
||||
assert (my_c.bar() == 3);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user