2011-07-15 15:33:40 -07:00
|
|
|
// Reduced test case for issue #543.
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
obj a() {
|
2011-07-27 14:19:39 +02:00
|
|
|
fn foo() -> int { ret 2; }
|
2011-07-15 15:33:40 -07:00
|
|
|
}
|
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
let my_a = a();
|
2011-07-15 15:33:40 -07:00
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
let my_b =
|
|
|
|
obj () {
|
|
|
|
fn foo() -> int { ret 3; }
|
|
|
|
with
|
|
|
|
my_a
|
|
|
|
};
|
2011-07-15 15:33:40 -07:00
|
|
|
|
|
|
|
assert (my_b.foo() == 3);
|
2011-08-19 15:16:48 -07:00
|
|
|
}
|