rust/src/test/run-pass/autoderef-method-twice.rs
2012-06-19 20:52:33 -07:00

9 lines
126 B
Rust

impl methods for uint {
fn double() -> uint { self * 2u }
}
fn main() {
let x = @@3u;
assert x.double() == 6u;
}