rust/src/test/run-pass/boxed-trait-with-vstore.rs
Patrick Walton fe9d07dda6 rustc: "as Trait" can now be written "as @Trait".
There is also code for ~Trait and &Trait, but these are currently (incorrectly)
synonyms for "as @Trait" and "as &Trait".
2012-08-15 16:20:31 -07:00

16 lines
160 B
Rust

trait Foo {
fn foo() {}
}
impl int : Foo {
fn foo() {
io::println("Hello world!");
}
}
fn main() {
let x = 3 as @Foo;
x.foo();
}