rust/src/test/run-pass/anon-obj-overriding-reduced.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

19 lines
276 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);
}