Reduced test case for issue #540.
This commit is contained in:
parent
a0c6d0a27f
commit
a33bc56e43
22
src/test/run-pass/anon-obj-with-self-call-2.rs
Normal file
22
src/test/run-pass/anon-obj-with-self-call-2.rs
Normal file
@ -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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user