diff options
| author | Lindsey Kuper <[email protected]> | 2011-05-10 19:52:22 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-05-13 17:35:13 -0700 |
| commit | 6c1c5b39482158f078b5b10164c024edf345e386 (patch) | |
| tree | 7c179784c98b97df43ff2329c96940452934f7b4 /src/test | |
| parent | Correct capitalization of "Option". (diff) | |
| download | rust-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')
| -rw-r--r-- | src/test/run-pass/method-overriding.rs | 10 |
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 } ; } |