From efd8ff46477caa89814bd5322619707873441c55 Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Tue, 21 Jun 2011 16:32:27 -0700 Subject: [PATCH] Comments for all the anon obj tests. --- src/test/run-pass/anon-obj-degenerate.rs | 2 ++ src/test/run-pass/anon-obj-overloading.rs | 6 ++++++ src/test/run-pass/anon-obj-with-self-call.rs | 5 ++++- src/test/run-pass/anon-objs-with-fields.rs | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/test/run-pass/anon-obj-degenerate.rs b/src/test/run-pass/anon-obj-degenerate.rs index 85d5bb3df52d..d534bd6db134 100644 --- a/src/test/run-pass/anon-obj-degenerate.rs +++ b/src/test/run-pass/anon-obj-degenerate.rs @@ -19,8 +19,10 @@ fn main() { // methods or fields. Adding support for this is issue #539. // (Making this work will also ensure that calls to anonymous // objects "fall through" appropriately.) + auto my_d = obj() { with my_a }; + // Right now, this fails with "unknown method 'foo' of obj". assert (my_d.foo() == 2); assert (my_d.bar() == 2); diff --git a/src/test/run-pass/anon-obj-overloading.rs b/src/test/run-pass/anon-obj-overloading.rs index c362c1788f27..343abc540229 100644 --- a/src/test/run-pass/anon-obj-overloading.rs +++ b/src/test/run-pass/anon-obj-overloading.rs @@ -30,5 +30,11 @@ fn main() { // 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); } diff --git a/src/test/run-pass/anon-obj-with-self-call.rs b/src/test/run-pass/anon-obj-with-self-call.rs index fc3aa838ac58..f5ab8e2ce68c 100644 --- a/src/test/run-pass/anon-obj-with-self-call.rs +++ b/src/test/run-pass/anon-obj-with-self-call.rs @@ -17,6 +17,9 @@ fn main() { // Extending an object with a new method that contains a simple // self-call. Adding support for this is issue #540. + + // Right now, this fails with a failed lookup in a hashmap; not + // sure where, but I think it might be during typeck. auto my_b = obj { fn baz() -> int { ret self.foo(); @@ -24,6 +27,6 @@ fn main() { with my_a }; - assert (my_b.baz() == 2); + assert my_b.baz() == 2); } diff --git a/src/test/run-pass/anon-objs-with-fields.rs b/src/test/run-pass/anon-objs-with-fields.rs index aa26415a4ff7..c4521926848a 100644 --- a/src/test/run-pass/anon-objs-with-fields.rs +++ b/src/test/run-pass/anon-objs-with-fields.rs @@ -17,6 +17,8 @@ fn main() { // Extending an object with a new field. Adding support for this // is issue #538. + + // Right now, this fails with "unresolved name: quux". auto my_c = obj(int quux = 3) { fn baz() -> int { ret quux + 4;