Remove private KTypeProjection.asString() that duplicates toString() logic

KT-30071 has been already fixed.
This commit is contained in:
Abduqodiri Qurbonzoda
2021-08-24 14:39:02 +03:00
committed by Space
parent 0abc798da9
commit 815329df15
@@ -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 "
}