Skip to content

Commit 7bb33e6

Browse files
committed
Add xfail'd test for a default method containing 'self'.
1 parent fb05f57 commit 7bb33e6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//xfail-test
2+
3+
// Right now, this fails with "attempted access of field `purr` on
4+
// type `self`, but no public field or method with that name was
5+
// found".
6+
7+
trait Cat {
8+
fn meow() -> bool;
9+
fn scratch() -> bool { self.purr() }
10+
fn purr() -> bool { true }
11+
}
12+
13+
impl int : Cat {
14+
fn meow() -> bool {
15+
self.scratch()
16+
}
17+
}
18+
19+
fn main() {
20+
assert 5.meow();
21+
}

0 commit comments

Comments
 (0)