- // eagerly replace projections in the type; we may be getting types
- // e.g. from where clauses where this hasn't happened yet
- let ty = ctx.normalize_associated_types_in(
- new_vars.apply(ty.assert_ty_ref(&Interner).clone(), &Interner),
- );
- ctx.table.unify(var.assert_ty_ref(&Interner), &ty);
+ if let Some(ty) = v.ty(&Interner) {
+ // eagerly replace projections in the type; we may be getting types
+ // e.g. from where clauses where this hasn't happened yet
+ let ty = ctx.normalize_associated_types_in(new_vars.apply(ty.clone(), &Interner));
+ ctx.table.unify(var.assert_ty_ref(&Interner), &ty);
+ } else {
+ let _ = ctx.table.unify_inner(&var, &new_vars.apply(v.clone(), &Interner));
+ }