From cf7870e376e325d4808abc8fc8954b7e44e981f1 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Fri, 11 Jun 2021 14:49:38 +0200 Subject: [PATCH] FIR IDE: implement toString for KtType --- .../kotlin/idea/frontend/api/types/KtType.kt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/idea/idea-frontend-api/src/org/jetbrains/kotlin/idea/frontend/api/types/KtType.kt b/idea/idea-frontend-api/src/org/jetbrains/kotlin/idea/frontend/api/types/KtType.kt index 7fcba07c89b..495d03b351d 100644 --- a/idea/idea-frontend-api/src/org/jetbrains/kotlin/idea/frontend/api/types/KtType.kt +++ b/idea/idea-frontend-api/src/org/jetbrains/kotlin/idea/frontend/api/types/KtType.kt @@ -28,9 +28,11 @@ enum class KtTypeNullability(val isNullable: Boolean) { } } -sealed class KtClassType : KtType +sealed class KtClassType : KtType { + override fun toString(): String = asStringForDebugging() +} -sealed class KtNonErrorClassType: KtClassType(), KtTypeWithNullability { +sealed class KtNonErrorClassType : KtClassType(), KtTypeWithNullability { abstract val classId: ClassId abstract val classSymbol: KtClassLikeSymbol abstract val typeArguments: List @@ -55,19 +57,27 @@ abstract class KtTypeParameterType : KtTypeWithNullability { abstract val symbol: KtTypeParameterSymbol } -abstract class KtCapturedType : KtType +abstract class KtCapturedType : KtType { + override fun toString(): String = asStringForDebugging() +} abstract class KtDefinitelyNotNullType : KtType, KtTypeWithNullability { abstract val original: KtType final override val nullability: KtTypeNullability get() = KtTypeNullability.NON_NULLABLE + + override fun toString(): String = asStringForDebugging() } abstract class KtFlexibleType : KtType { abstract val lowerBound: KtType abstract val upperBound: KtType + + override fun toString(): String = asStringForDebugging() } -abstract class KtIntersectionType : KtType{ +abstract class KtIntersectionType : KtType { abstract val conjuncts: List + + override fun toString(): String = asStringForDebugging() } \ No newline at end of file