aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass
diff options
context:
space:
mode:
authorLindsey Kuper <[email protected]>2011-05-06 17:08:41 -0700
committerGraydon Hoare <[email protected]>2011-05-13 17:35:12 -0700
commit7c2979e26f23739b62fcda7500d4c5eac092c42c (patch)
tree64bd9f4fb3176e0d352d9770efb009c9eb8d0d27 /src/test/run-pass
parentAdd support for 'T' transition snapshots, which are identical to S snapshots ... (diff)
downloadrust-7c2979e26f23739b62fcda7500d4c5eac092c42c.tar.xz
rust-7c2979e26f23739b62fcda7500d4c5eac092c42c.zip
Starting on support for anonymous objects. Just syntax so far.
Diffstat (limited to 'src/test/run-pass')
-rw-r--r--src/test/run-pass/method-overriding.rs26
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
+ };
+
+}