Add xfail'd test for a default method containing 'self'.
This commit is contained in:
parent
fb05f57881
commit
7bb33e6f1b
1 changed files with 21 additions and 0 deletions
21
src/test/run-pass/traits-default-method-self.rs
Normal file
21
src/test/run-pass/traits-default-method-self.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
//xfail-test
|
||||
|
||||
// Right now, this fails with "attempted access of field `purr` on
|
||||
// type `self`, but no public field or method with that name was
|
||||
// found".
|
||||
|
||||
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();
|
||||
}
|
Loading…
Add table
Reference in a new issue