Skip to content

Commit 18018bd

Browse files
committed
---
yaml --- r: 3296 b: refs/heads/master c: efd8ff4 h: refs/heads/master v: v3
1 parent 9157c73 commit 18018bd

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
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: 7fb35ecf84c3fd5f92c2af287d478eb70cbacdbd
2+
refs/heads/master: efd8ff46477caa89814bd5322619707873441c55

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ fn main() {
1919
// methods or fields. Adding support for this is issue #539.
2020
// (Making this work will also ensure that calls to anonymous
2121
// objects "fall through" appropriately.)
22+
2223
auto my_d = obj() { with my_a };
2324

25+
// Right now, this fails with "unknown method 'foo' of obj".
2426
assert (my_d.foo() == 2);
2527
assert (my_d.bar() == 2);
2628

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,11 @@ fn main() {
3030

3131
// The tricky part -- have to be sure to tie the knot in the right
3232
// place, so that bar() knows about the new foo().
33+
34+
// Right now, this just fails with "unknown method 'bar' of obj",
35+
// but that's the easier of our worries; that'll be fixed when
36+
// issue #539 is fixed. The bigger problem will be when we do
37+
// 'fall through' to bar() on the original object -- then we have
38+
// to be sure that self refers to the extended object.
3339
assert (my_b.bar() == 3);
3440
}

trunk/src/test/run-pass/anon-obj-with-self-call.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ fn main() {
1717

1818
// Extending an object with a new method that contains a simple
1919
// self-call. Adding support for this is issue #540.
20+
21+
// Right now, this fails with a failed lookup in a hashmap; not
22+
// sure where, but I think it might be during typeck.
2023
auto my_b = obj {
2124
fn baz() -> int {
2225
ret self.foo();
2326
}
2427
with my_a
2528
};
2629

27-
assert (my_b.baz() == 2);
30+
assert my_b.baz() == 2);
2831

2932
}

trunk/src/test/run-pass/anon-objs-with-fields.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ fn main() {
1717

1818
// Extending an object with a new field. Adding support for this
1919
// is issue #538.
20+
21+
// Right now, this fails with "unresolved name: quux".
2022
auto my_c = obj(int quux = 3) {
2123
fn baz() -> int {
2224
ret quux + 4;

0 commit comments

Comments
 (0)