Skip to content

Commit febcc81

Browse files
committed
---
yaml --- r: 4027 b: refs/heads/master c: 431cb9a h: refs/heads/master i: 4025: 8dc70f1 4023: 31cd42b v: v3
1 parent 1cd95d2 commit febcc81

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 336949a5908c27759b3bce0bb6678860d63eb047
2+
refs/heads/master: 431cb9a3454fe19fe6987aebb3b3655dc9eca8ad

trunk/src/test/run-pass/anon-obj-overriding.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,21 @@ fn main() {
2626

2727
assert (my_b.foo() == 3);
2828
assert (my_b.bar() == 3);
29+
30+
auto my_c = obj() {
31+
fn baz(int x, int y) -> int {
32+
ret x + y + self.foo();
33+
}
34+
with my_b
35+
};
36+
37+
auto my_d = obj() {
38+
fn baz(int x, int y) -> int {
39+
ret x + y + self.foo();
40+
}
41+
with my_a
42+
};
43+
44+
assert (my_c.baz(1, 2) == 6);
45+
assert (my_d.baz(1, 2) == 5);
2946
}

0 commit comments

Comments
 (0)