isFlexible() turned into a method in JetType

Otherwise delegated types were never recognized as flexible
This commit is contained in:
Andrey Breslav
2014-09-17 16:07:17 +04:00
parent 91b0b83ec3
commit 40932f84c8
15 changed files with 120 additions and 68 deletions
@@ -28,7 +28,6 @@ import org.jetbrains.jet.lang.resolve.calls.model.VariableAsFunctionResolvedCall
import org.jetbrains.jet.lang.types.BoundsSubstitutor;
import org.jetbrains.jet.lang.types.JetType;
import org.jetbrains.jet.lang.types.TypeUtils;
import org.jetbrains.jet.lang.types.TypesPackage;
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
@@ -244,8 +243,8 @@ public class OverloadingConflictResolver {
numericTypeMoreSpecific(specific, general);
if (!isSubtype) return false;
boolean specificIsFlexible = TypesPackage.isFlexible(specific);
boolean generalIsFlexible = TypesPackage.isFlexible(general);
boolean specificIsFlexible = specific.isFlexible();
boolean generalIsFlexible = general.isFlexible();
if (specificIsFlexible && !generalIsFlexible) {
// Int! lessSpecific Int
@@ -24,7 +24,6 @@ import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
import org.jetbrains.jet.lang.descriptors.annotations.Annotations;
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
import org.jetbrains.jet.lang.types.FlexibleType;
import org.jetbrains.jet.lang.types.JetType;
import org.jetbrains.jet.lang.types.TypeConstructor;
import org.jetbrains.jet.lang.types.TypeProjection;
@@ -87,10 +86,9 @@ public class ForceResolveUtil {
public static JetType forceResolveAllContents(@Nullable JetType type) {
if (type == null) return null;
if (type instanceof FlexibleType) {
FlexibleType flexibleType = (FlexibleType) type;
forceResolveAllContents(flexibleType.getLowerBound());
forceResolveAllContents(flexibleType.getUpperBound());
if (type.isFlexible()) {
forceResolveAllContents(type.getLowerBound());
forceResolveAllContents(type.getUpperBound());
}
else {
forceResolveAllContents(type.getConstructor());