Replace usage of ClassicTCContext with abstract context in NewCSTCalculator

This commit is contained in:
Dmitriy Novozhilov
2019-07-25 11:57:37 +03:00
committed by Mikhail Glukhikh
parent 0276a6262f
commit 6215662e33
4 changed files with 18 additions and 7 deletions
@@ -16,9 +16,6 @@
package org.jetbrains.kotlin.resolve.calls
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.resolve.constants.IntegerLiteralTypeConstructor
import org.jetbrains.kotlin.types.*
import org.jetbrains.kotlin.types.checker.*
import org.jetbrains.kotlin.types.AbstractNullabilityChecker.hasPathByNotMarkedNullableNodes
@@ -181,7 +178,7 @@ object NewCommonSuperTypeCalculator {
nullable = false
)
val typeCheckerContext = ClassicTypeCheckerContext(false)
val typeCheckerContext = newBaseTypeCheckerContext(false)
/**
* Sometimes one type can have several supertypes with given type constructor, suppose A <: List<Int> and A <: List<Double>.
@@ -86,7 +86,9 @@ class ResultTypeResolver(
val lowerConstraints = variableWithConstraints.constraints.filter { it.kind == ConstraintKind.LOWER && isProperType(it.type) }
if (lowerConstraints.isNotEmpty()) {
val types = sinkIntegerLiteralTypes(lowerConstraints.map { it.type })
val commonSuperType = with(NewCommonSuperTypeCalculator) { commonSuperType(types) }
val commonSuperType = with(NewCommonSuperTypeCalculator) {
this@findSubType.commonSuperType(types)
}
/**
*
* fun <T> Array<out T>.intersect(other: Iterable<T>) {