aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/method-overriding.rs
diff options
context:
space:
mode:
authorLindsey Kuper <[email protected]>2011-05-10 19:52:22 -0700
committerGraydon Hoare <[email protected]>2011-05-13 17:35:13 -0700
commit6c1c5b39482158f078b5b10164c024edf345e386 (patch)
tree7c179784c98b97df43ff2329c96940452934f7b4 /src/test/run-pass/method-overriding.rs
parentCorrect capitalization of "Option". (diff)
downloadrust-6c1c5b39482158f078b5b10164c024edf345e386.tar.xz
rust-6c1c5b39482158f078b5b10164c024edf345e386.zip
More progress on anonymous objects.
Still segfaulting on the method-overriding.rs test, though.
Diffstat (limited to 'src/test/run-pass/method-overriding.rs')
-rw-r--r--src/test/run-pass/method-overriding.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/run-pass/method-overriding.rs b/src/test/run-pass/method-overriding.rs
index bf68ddd1..3fbb53ff 100644
--- a/src/test/run-pass/method-overriding.rs
+++ b/src/test/run-pass/method-overriding.rs
@@ -1,7 +1,7 @@
// xfail-boot
// xfail-stage0
use std;
-import std._vec.len;
+
fn main() {
obj a() {
@@ -15,12 +15,18 @@ fn main() {
auto my_a = a();
- // Step 1 is to add support for this "with" syntax
+ // Extending an object with a new method
auto my_b = obj {
fn baz() -> int {
ret self.foo();
}
with my_a
};
+
+ // Extending an object with a new field
+ auto my_c = obj(quux) { with my_a } ;
+
+ // Should this be legal?
+ auto my_d = obj() { with my_a } ;
}