rename replaceTypeVariables -> createNewConstraintSystemFromThis

This commit is contained in:
Svetlana Isakova
2013-10-09 18:54:49 +04:00
parent 4ab3d50e4d
commit 4bf5bb18e9
2 changed files with 41 additions and 42 deletions
@@ -579,14 +579,15 @@ public class CandidateResolver {
constraintSystem.addSubtypeConstraint(receiverType, receiverParameter.getType(), ConstraintPosition.RECEIVER_POSITION);
}
ConstraintSystem constraintSystemWithRightTypeParameters = constraintSystem.replaceTypeVariables(
// Restore type variables before alpha-conversion
ConstraintSystem constraintSystemWithRightTypeParameters = constraintSystem.substituteTypeVariables(
new Function<TypeParameterDescriptor, TypeParameterDescriptor>() {
@Override
public TypeParameterDescriptor apply(@Nullable TypeParameterDescriptor typeParameterDescriptor) {
assert typeParameterDescriptor != null;
return candidate.getTypeParameters().get(typeParameterDescriptor.getIndex());
}
});
@Override
public TypeParameterDescriptor apply(@Nullable TypeParameterDescriptor typeParameterDescriptor) {
assert typeParameterDescriptor != null;
return candidate.getTypeParameters().get(typeParameterDescriptor.getIndex());
}
});
candidateCall.setConstraintSystem(constraintSystemWithRightTypeParameters);