diff options
| author | Lindsey Kuper <[email protected]> | 2011-05-06 17:08:41 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-05-13 17:35:12 -0700 |
| commit | 7c2979e26f23739b62fcda7500d4c5eac092c42c (patch) | |
| tree | 64bd9f4fb3176e0d352d9770efb009c9eb8d0d27 /src/test | |
| parent | Add support for 'T' transition snapshots, which are identical to S snapshots ... (diff) | |
| download | rust-7c2979e26f23739b62fcda7500d4c5eac092c42c.tar.xz rust-7c2979e26f23739b62fcda7500d4c5eac092c42c.zip | |
Starting on support for anonymous objects. Just syntax so far.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/method-overriding.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/run-pass/method-overriding.rs b/src/test/run-pass/method-overriding.rs new file mode 100644 index 00000000..bf68ddd1 --- /dev/null +++ b/src/test/run-pass/method-overriding.rs @@ -0,0 +1,26 @@ +// xfail-boot +// xfail-stage0 +use std; +import std._vec.len; +fn main() { + + obj a() { + fn foo() -> int { + ret 2; + } + fn bar() -> int { + ret self.foo(); + } + } + + auto my_a = a(); + + // Step 1 is to add support for this "with" syntax + auto my_b = obj { + fn baz() -> int { + ret self.foo(); + } + with my_a + }; + +} |