summary refs log tree commit diff
path: root/src/test/run-pass/traits-default-method-self.rs
blob: 059d1c0b41664e8845008d33b0b025f202bc0b5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//xfail-test

// Currently failing with an ICE in trans.  (FIXME: #2794)

trait Cat {
    fn meow() -> bool;
    fn scratch() -> bool { self.purr() }
    fn purr() -> bool { true }
}

impl int : Cat {
    fn meow() -> bool {
        self.scratch()
    }
}

fn main() {
    assert 5.meow();
}