aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass
diff options
context:
space:
mode:
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
+ };
+
+}