From 815329df155c2bd2526ad5b170e9351e20e25432 Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Tue, 24 Aug 2021 14:39:02 +0300 Subject: [PATCH] Remove private KTypeProjection.asString() that duplicates toString() logic KT-30071 has been already fixed. --- .../stdlib/js/src/kotlin/reflect/KTypeImpl.kt | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/libraries/stdlib/js/src/kotlin/reflect/KTypeImpl.kt b/libraries/stdlib/js/src/kotlin/reflect/KTypeImpl.kt index 281c309cefa..d939558e1f4 100644 --- a/libraries/stdlib/js/src/kotlin/reflect/KTypeImpl.kt +++ b/libraries/stdlib/js/src/kotlin/reflect/KTypeImpl.kt @@ -29,17 +29,11 @@ internal class KTypeImpl( val args = if (arguments.isEmpty()) "" - else arguments.joinToString(", ", "<", ">") { it.asString() } + else arguments.joinToString(", ", "<", ">") val nullable = if (isMarkedNullable) "?" else "" return classifierName + args + nullable } - - // TODO: this should be the implementation of KTypeProjection.toString, see KT-30071 - private fun KTypeProjection.asString(): String { - if (variance == null) return "*" - return variance.prefixString() + type.toString() - } } internal object DynamicKType : KType { @@ -48,10 +42,3 @@ internal object DynamicKType : KType { override val isMarkedNullable: Boolean = false override fun toString(): String = "dynamic" } - -internal fun KVariance.prefixString() = - when (this) { - KVariance.INVARIANT -> "" - KVariance.IN -> "in " - KVariance.OUT -> "out " - }