Skip to content

Commit

Permalink
Reduced test case for issue #540.
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuper committed Jul 19, 2011
1 parent a0c6d0a commit a33bc56
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/test/run-pass/anon-obj-with-self-call-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//xfail-stage0
//xfail-stage1
//xfail-stage2

// Reduced test case for issue #540.
fn main() {
obj a() {
fn foo() -> int {
ret 2;
}
}

auto my_a = a();
auto my_b = obj {
fn baz() -> int {
ret self.foo();
}
with my_a
};

assert (my_b.baz() == 2);
}

0 comments on commit a33bc56

Please sign in to comment.