fix compilation (KtType -> KotlinType)

This commit is contained in:
Michael Nedzelsky
2015-10-20 20:45:27 +03:00
parent 1c36090b6d
commit f987feed6f
2 changed files with 8 additions and 8 deletions
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.diagnostics.DiagnosticSink
import org.jetbrains.kotlin.diagnostics.Errors
import org.jetbrains.kotlin.psi.KtClass
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.types.KtType
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeConstructor
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.Variance
@@ -116,7 +116,7 @@ public object NonExpansiveInheritanceRestrictionChecker {
// upper bounds of a skolem type variable Q in a skolemization of a projected generic type in ST, add an
// expanding edge from T to V, where V is the type parameter corresponding to Q.
val originalTypeParameter = constituentTypeConstructor.parameters[i]
val bounds = hashSetOf<KtType>()
val bounds = hashSetOf<KotlinType>()
val substitutor = constituentType.substitution.buildSubstitutor()
val adaptedUpperBounds = originalTypeParameter.upperBounds.map { substitutor.substitute(it, Variance.INVARIANT) }.filterNotNull()
@@ -141,7 +141,7 @@ public fun KotlinType.isDefaultBound(): Boolean = KotlinBuiltIns.isDefaultBound(
public fun createProjection(type: KotlinType, projectionKind: Variance, typeParameterDescriptor: TypeParameterDescriptor?): TypeProjection =
TypeProjectionImpl(if (typeParameterDescriptor?.variance == projectionKind) Variance.INVARIANT else projectionKind, type)
fun Collection<KtType>.closure(f: (KtType) -> Collection<KtType>): Collection<KtType> {
fun Collection<KotlinType>.closure(f: (KotlinType) -> Collection<KotlinType>): Collection<KotlinType> {
if (size == 0) return this
val result = HashSet(this)
@@ -149,7 +149,7 @@ fun Collection<KtType>.closure(f: (KtType) -> Collection<KtType>): Collection<Kt
var oldSize = 0
while (result.size > oldSize) {
oldSize = result.size
val toAdd = hashSetOf<KtType>()
val toAdd = hashSetOf<KotlinType>()
elementsToCheck.forEach { toAdd.addAll(f(it)) }
result.addAll(toAdd)
elementsToCheck = toAdd
@@ -158,16 +158,16 @@ fun Collection<KtType>.closure(f: (KtType) -> Collection<KtType>): Collection<Kt
return result
}
fun boundClosure(types: Collection<KtType>): Collection<KtType> =
fun boundClosure(types: Collection<KotlinType>): Collection<KotlinType> =
types.closure { type -> TypeUtils.getTypeParameterDescriptorOrNull(type)?.upperBounds ?: emptySet() }
fun constituentTypes(types: Collection<KtType>): Collection<KtType> {
val result = hashSetOf<KtType>()
fun constituentTypes(types: Collection<KotlinType>): Collection<KotlinType> {
val result = hashSetOf<KotlinType>()
constituentTypes(result, types)
return result
}
private fun constituentTypes(result: MutableSet<KtType>, types: Collection<KtType>) {
private fun constituentTypes(result: MutableSet<KotlinType>, types: Collection<KotlinType>) {
result.addAll(types)
for (type in types) {
if (type.isFlexible()) {