aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/method-overriding.rs
blob: bf68ddd1e428939d6325d334a667a8a4da7e6efe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 
    };
    
}