Skip to content

Commit

Permalink
Reduced test case for current backwarding bug.
Browse files Browse the repository at this point in the history
Still working on getting backwarding to play nicely with self and
overriding.  Currently can't fix issue #702 without breaking how self
and overriding interact.
  • Loading branch information
lkuper committed Jul 30, 2011
1 parent a34f7c8 commit 6ba4e34
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/test/run-pass/anon-obj-backwarding-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//xfail-stage0
//xfail-stage1
//xfail-stage2
//xfail-stage3
use std;

fn main() {

obj a() {
fn foo() -> int { ret 2; }
fn bar() -> int { ret self.foo(); }
}

let my_a = a();

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

// These should all be 2.
log_err my_a.foo();
log_err my_a.bar();
log_err my_b.foo();

// This works fine. It sends us to foo on my_b, which forwards to
// foo on my_a.
log_err my_b.baz();

// Currently segfaults. It forwards us to bar on my_a, which
// backwards us to foo on my_b, which forwards us to foo on my_a
// -- or, at least, that's how it should work.
log_err my_b.bar();

}

0 comments on commit 6ba4e34

Please sign in to comment.