Closed
Description
The following crashes:
trait double {
fn double() -> uint;
}
impl uint: double {
fn double() -> uint { self * 2u }
}
fn is_equal<D: double>(x: @D, exp: uint) {
assert x.double() == exp;
}
fn main() {
let x = @(3u as double);
is_equal(x, 6);
}
This is because the autoderef code is not being used if the call occurs in a monomorphized context. My trans refactoring should fix this.