From f987feed6ffd508a8c69b5659c816990257007ec Mon Sep 17 00:00:00 2001 From: Michael Nedzelsky Date: Tue, 20 Oct 2015 20:45:27 +0300 Subject: [PATCH] fix compilation (KtType -> KotlinType) --- .../NonExpansiveInheritanceRestrictionChecker.kt | 4 ++-- .../src/org/jetbrains/kotlin/types/TypeUtils.kt | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/NonExpansiveInheritanceRestrictionChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/NonExpansiveInheritanceRestrictionChecker.kt index 03f2406b2ad..b74617e78e6 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/NonExpansiveInheritanceRestrictionChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/NonExpansiveInheritanceRestrictionChecker.kt @@ -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() + val bounds = hashSetOf() val substitutor = constituentType.substitution.buildSubstitutor() val adaptedUpperBounds = originalTypeParameter.upperBounds.map { substitutor.substitute(it, Variance.INVARIANT) }.filterNotNull() diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt index 0cb5b16ba61..58230a5ab53 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt @@ -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.closure(f: (KtType) -> Collection): Collection { +fun Collection.closure(f: (KotlinType) -> Collection): Collection { if (size == 0) return this val result = HashSet(this) @@ -149,7 +149,7 @@ fun Collection.closure(f: (KtType) -> Collection): Collection oldSize) { oldSize = result.size - val toAdd = hashSetOf() + val toAdd = hashSetOf() elementsToCheck.forEach { toAdd.addAll(f(it)) } result.addAll(toAdd) elementsToCheck = toAdd @@ -158,16 +158,16 @@ fun Collection.closure(f: (KtType) -> Collection): Collection): Collection = +fun boundClosure(types: Collection): Collection = types.closure { type -> TypeUtils.getTypeParameterDescriptorOrNull(type)?.upperBounds ?: emptySet() } -fun constituentTypes(types: Collection): Collection { - val result = hashSetOf() +fun constituentTypes(types: Collection): Collection { + val result = hashSetOf() constituentTypes(result, types) return result } -private fun constituentTypes(result: MutableSet, types: Collection) { +private fun constituentTypes(result: MutableSet, types: Collection) { result.addAll(types) for (type in types) { if (type.isFlexible()) {