removed method hasContradiction() from ConstraintSystem interface
rename
This commit is contained in:
@@ -170,7 +170,7 @@ public class Renderers {
|
||||
|
||||
public static TabledDescriptorRenderer renderConflictingSubstitutionsInferenceError(InferenceErrorData inferenceErrorData,
|
||||
TabledDescriptorRenderer result) {
|
||||
assert inferenceErrorData.constraintsSystem.hasConflictingParameters();
|
||||
assert inferenceErrorData.constraintsSystem.hasConflictingConstraints();
|
||||
|
||||
Collection<CallableDescriptor> substitutedDescriptors = Lists.newArrayList();
|
||||
Collection<TypeSubstitutor> substitutors = ConstraintsUtil.getSubstitutorsForConflictingParameters(
|
||||
|
||||
@@ -394,7 +394,7 @@ public class CallResolver {
|
||||
if (inferenceErrorData.constraintsSystem.hasTypeConstructorMismatch()) {
|
||||
trace.report(TYPE_INFERENCE_TYPE_CONSTRUCTOR_MISMATCH.on(element, inferenceErrorData));
|
||||
}
|
||||
else if (inferenceErrorData.constraintsSystem.hasConflictingParameters()) {
|
||||
else if (inferenceErrorData.constraintsSystem.hasConflictingConstraints()) {
|
||||
trace.report(TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS.on(element, inferenceErrorData));
|
||||
}
|
||||
else {
|
||||
@@ -760,7 +760,7 @@ public class CallResolver {
|
||||
|
||||
|
||||
// Solution
|
||||
if (!constraintsSystem.hasContradiction()) {
|
||||
if (!constraintsSystem.hasTypeConstructorMismatch() && !constraintsSystem.hasConflictingConstraints()) { //no contradiction
|
||||
candidateCall.setHasUnknownTypeParameters(true);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
+6
-11
@@ -87,8 +87,8 @@ public class ConstraintsSystemImpl implements ConstraintsSystem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTypeVariable(@NotNull TypeParameterDescriptor typeParameterDescriptor, @NotNull Variance positionVariance) {
|
||||
typeParameterConstraints.put(typeParameterDescriptor, new TypeConstraintsImpl(positionVariance));
|
||||
public void registerTypeVariable(@NotNull TypeParameterDescriptor typeVariable, @NotNull Variance positionVariance) {
|
||||
typeParameterConstraints.put(typeVariable, new TypeConstraintsImpl(positionVariance));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -198,22 +198,17 @@ public class ConstraintsSystemImpl implements ConstraintsSystem {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public TypeConstraints getTypeConstraints(@NotNull TypeParameterDescriptor typeParameterDescriptor) {
|
||||
return typeParameterConstraints.get(typeParameterDescriptor);
|
||||
public TypeConstraints getTypeConstraints(@NotNull TypeParameterDescriptor typeVariable) {
|
||||
return typeParameterConstraints.get(typeVariable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuccessful() {
|
||||
return !hasTypeConstructorMismatch() && !hasUnknownParameters() && !hasConflictingParameters();
|
||||
return !hasTypeConstructorMismatch() && !hasUnknownParameters() && !hasConflictingConstraints();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContradiction() {
|
||||
return hasTypeConstructorMismatch() || hasConflictingParameters();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasConflictingParameters() {
|
||||
public boolean hasConflictingConstraints() {
|
||||
for (TypeParameterDescriptor typeParameter : typeParameterConstraints.keySet()) {
|
||||
TypeConstraints typeConstraints = getTypeConstraints(typeParameter);
|
||||
if (typeConstraints != null && ConstraintsUtil.getValues(typeConstraints).size() > 1) return true;
|
||||
|
||||
Reference in New Issue
Block a user