rust/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs
2012-08-08 18:19:24 -07:00

13 lines
172 B
Rust

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