rust/src/test/run-pass/anon-obj-overriding-reduced.rs
2011-07-27 15:54:33 +02:00

18 lines
275 B
Rust

// Reduced test case for issue #543.
fn main() {
obj a() {
fn foo() -> int { ret 2; }
}
let my_a = a();
let my_b =
obj () {
fn foo() -> int { ret 3; }
with
my_a
};
assert (my_b.foo() == 3);
}