Skip to content

Commit a5285f1

Browse files
committed
Add test for issue 3305
1 parent 21b4d82 commit a5285f1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test/run-pass/issue-3305.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
trait double {
2+
fn double() -> uint;
3+
}
4+
5+
impl uint: double {
6+
fn double() -> uint { self * 2u }
7+
}
8+
9+
fn is_equal<D: double>(x: @D, exp: uint) {
10+
assert x.double() == exp;
11+
}
12+
13+
fn main() {
14+
let x = @(3u as double);
15+
is_equal(x, 6);
16+
}

0 commit comments

Comments
 (0)