rustc: Unify impl self types in the opposite order so variance is correct

This commit is contained in:
Brian Anderson
2012-03-16 16:49:11 -07:00
parent 3445454e79
commit 154a3fdf44
3 changed files with 16 additions and 4 deletions

View File

@@ -1909,7 +1909,7 @@ fn lookup_method_inner(fcx: @fn_ctxt, expr: @ast::expr,
let ty = universally_quantify_regions(tcx, ty);
alt unify::unify(fcx, ty, self_ty) {
alt unify::unify(fcx, self_ty, ty) {
result::ok(_) {
if option::is_some(result) {
// FIXME[impl] score specificity to resolve ambiguity?