about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorLindsey Kuper <lkuper@mozilla.com>2011-07-07 17:10:17 -0700
committerLindsey Kuper <lkuper@mozilla.com>2011-07-07 17:29:15 -0700
commit32431440469f403b1532e25dfd60c3d958840dc1 (patch)
tree99d3e0c082357e94081ad2a508e047c8f93b1752 /src/test
parent301f6aaa31594f996ae70ed84cf4e2ba7d8b3030 (diff)
downloadrust-32431440469f403b1532e25dfd60c3d958840dc1.tar.gz
rust-32431440469f403b1532e25dfd60c3d958840dc1.zip
Fix a bug that was interfering with method overriding. Issue #543.
Previously, we were creating both a normal vtable entry and a
forwarding function for overriding methods, when they should have just
gotten a vtable entry.  This patch fixes that.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/anon-obj-overloading.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/test/run-pass/anon-obj-overloading.rs b/src/test/run-pass/anon-obj-overloading.rs
index dfaddbb042f..d71244cc313 100644
--- a/src/test/run-pass/anon-obj-overloading.rs
+++ b/src/test/run-pass/anon-obj-overloading.rs
@@ -16,9 +16,7 @@ fn main() {
 
     auto my_a = a();
 
-    // An anonymous object that overloads the 'foo' method.  Adding
-    // support for this is issue #543 (making this work in the
-    // presence of self-calls is the tricky part).
+    // An anonymous object that overloads the 'foo' method.
     auto my_b = obj() {
         fn foo() -> int {
             ret 3;
@@ -27,15 +25,7 @@ fn main() {
         with my_a
     };
 
+    // FIXME: raises a valgrind error (issue #543).
     assert (my_b.foo() == 3);
-
-    // The tricky part -- have to be sure to tie the knot in the right
-    // place, so that bar() knows about the new foo().
-
-    // Right now, this just fails with "unknown method 'bar' of obj",
-    // but that's the easier of our worries; that'll be fixed when
-    // issue #539 is fixed.  The bigger problem will be when we do
-    // 'fall through' to bar() on the original object -- then we have
-    // to be sure that self refers to the extended object.
     assert (my_b.bar() == 3);
 }