2011-07-20 15:19:22 -07:00
|
|
|
//xfail-stage0
|
|
|
|
//xfail-stage1
|
|
|
|
//xfail-stage2
|
2011-07-20 19:37:09 -07:00
|
|
|
//xfail-stage3
|
2011-07-20 15:19:22 -07:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
obj a() {
|
|
|
|
fn foo() -> int {
|
|
|
|
ret 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto my_a = a();
|
|
|
|
|
|
|
|
auto my_b = obj() {
|
|
|
|
with my_a
|
|
|
|
};
|
|
|
|
|
|
|
|
assert (my_b.foo() == 2);
|
|
|
|
|
|
|
|
auto my_c = obj() {
|
|
|
|
with my_b
|
|
|
|
};
|
|
|
|
|
|
|
|
assert (my_c.foo() == 2);
|
|
|
|
}
|
|
|
|
|