diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt index 77e76db2817..3178c316b0b 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.kt @@ -130,7 +130,7 @@ fun KotlinType.isDefaultBound(): Boolean = KotlinBuiltIns.isDefaultBound(getSupe fun createProjection(type: KotlinType, projectionKind: Variance, typeParameterDescriptor: TypeParameterDescriptor?): TypeProjection = TypeProjectionImpl(if (typeParameterDescriptor?.variance == projectionKind) Variance.INVARIANT else projectionKind, type) -fun Collection.closure(f: (KotlinType) -> Collection): Collection { +fun Collection.closure(f: (T) -> Collection): Collection { if (size == 0) return this val result = HashSet(this) @@ -138,7 +138,7 @@ fun Collection.closure(f: (KotlinType) -> Collection): C var oldSize = 0 while (result.size > oldSize) { oldSize = result.size - val toAdd = hashSetOf() + val toAdd = hashSetOf() elementsToCheck.forEach { toAdd.addAll(f(it)) } result.addAll(toAdd) elementsToCheck = toAdd