rust/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs

9 lines
133 B
Rust
Raw Normal View History

2012-06-19 22:52:33 -05:00
impl methods for @@uint {
fn double() -> uint { **self * 2u }
}
fn main() {
let x = @@@@@3u;
assert x.double() == 6u;
}