small refactoring

This commit is contained in:
Svetlana Isakova
2013-06-06 16:30:43 +04:00
parent f41584c7ab
commit 12ef42b6ae
@@ -551,7 +551,8 @@ public class BodyResolver {
} }
addConstraintForThisValue(constraintSystem, descriptor); addConstraintForThisValue(constraintSystem, descriptor);
} }
if (propertyDescriptor.isVar()) { if (!propertyDescriptor.isVar()) return;
OverloadResolutionResults<FunctionDescriptor> setMethodResults = OverloadResolutionResults<FunctionDescriptor> setMethodResults =
DelegatedPropertyUtils.getDelegatedPropertyConventionMethod( DelegatedPropertyUtils.getDelegatedPropertyConventionMethod(
propertyDescriptor, delegateExpression, returnType, expressionTypingServices, propertyDescriptor, delegateExpression, returnType, expressionTypingServices,
@@ -562,12 +563,12 @@ public class BodyResolver {
List<ValueParameterDescriptor> valueParameters = descriptor.getValueParameters(); List<ValueParameterDescriptor> valueParameters = descriptor.getValueParameters();
if (valueParameters.size() == 3) { if (valueParameters.size() == 3) {
ValueParameterDescriptor valueParameterForThis = valueParameters.get(2); ValueParameterDescriptor valueParameterForThis = valueParameters.get(2);
constraintSystem.addSubtypeConstraint(expectedType, valueParameterForThis.getType(), ConstraintPosition.FROM_COMPLETER); constraintSystem.addSubtypeConstraint(expectedType, valueParameterForThis.getType(), ConstraintPosition.FROM_COMPLETER);
addConstraintForThisValue(constraintSystem, descriptor); addConstraintForThisValue(constraintSystem, descriptor);
} }
} }
} }
}
private boolean conventionMethodFound(@NotNull OverloadResolutionResults<FunctionDescriptor> results) { private boolean conventionMethodFound(@NotNull OverloadResolutionResults<FunctionDescriptor> results) {
return results.isSuccess() || return results.isSuccess() ||
@@ -585,6 +586,7 @@ public class BodyResolver {
List<ValueParameterDescriptor> valueParameters = resultingDescriptor.getValueParameters(); List<ValueParameterDescriptor> valueParameters = resultingDescriptor.getValueParameters();
if (valueParameters.isEmpty()) return; if (valueParameters.isEmpty()) return;
ValueParameterDescriptor valueParameterForThis = valueParameters.get(0); ValueParameterDescriptor valueParameterForThis = valueParameters.get(0);
constraintSystem.addSubtypeConstraint(typeOfThis, valueParameterForThis.getType(), ConstraintPosition.FROM_COMPLETER); constraintSystem.addSubtypeConstraint(typeOfThis, valueParameterForThis.getType(), ConstraintPosition.FROM_COMPLETER);
} }
}; };