aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-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 } ;
}