summary refs log tree commit diff
path: root/src/test/run-pass/autoderef-method-priority.rs
blob: e44a210a57cbc59ea5d39ed7e417355d29da3a7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
trait double {
    fn double() -> uint;
}

impl uint: double {
    fn double() -> uint { self }
}

impl @uint: double {
    fn double() -> uint { *self * 2u }
}

fn main() {
    let x = @3u;
    assert x.double() == 6u;
}