rust/src/test/run-pass/traits-default-method-self.rs

20 lines
276 B
Rust
Raw Normal View History

//xfail-test
// Currently failing with an ICE in trans.
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();
}