rust/src/test/run-pass/autoderef-method-on-trait.rs
Niko Matsakis 5e36a99794 Refactor trans to replace lvalue and friends with Datum.
Also:
- report illegal move/ref combos whether or not ref comes first
- commented out fix for #3387, too restrictive and causes an ICE
2012-09-06 06:11:12 -07:00

13 lines
176 B
Rust

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