aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2023-08-16 21:34:59 +0300
committerGitHub <noreply@github.com>2023-08-16 21:34:59 +0300
commit97bccc0e12fdc8c3bd6d178e17fdfb57c3514489 (patch)
treed5df516b259404036fbbace1174b04e31fb62c8a
parent34d6927e469c8c64e15fa41261c5f38905485fd8 (diff)
downloaddokka-97bccc0e12fdc8c3bd6d178e17fdfb57c3514489.tar.gz
dokka-97bccc0e12fdc8c3bd6d178e17fdfb57c3514489.tar.bz2
dokka-97bccc0e12fdc8c3bd6d178e17fdfb57c3514489.zip
Fix cast to `ClassDescriptor` error (#3118)
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorFullClassHierarchyBuilder.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorFullClassHierarchyBuilder.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorFullClassHierarchyBuilder.kt
index 22350bfc..d366e797 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorFullClassHierarchyBuilder.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorFullClassHierarchyBuilder.kt
@@ -11,7 +11,7 @@ import org.jetbrains.dokka.utilities.parallelForEach
import org.jetbrains.dokka.analysis.kotlin.internal.ClassHierarchy
import org.jetbrains.dokka.analysis.kotlin.internal.FullClassHierarchyBuilder
import org.jetbrains.dokka.analysis.kotlin.internal.Supertypes
-import org.jetbrains.kotlin.descriptors.ClassDescriptor
+import org.jetbrains.kotlin.descriptors.ClassifierDescriptorWithTypeParameters
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.immediateSupertypes
import org.jetbrains.kotlin.types.typeUtil.isAnyOrNullableAny
@@ -72,7 +72,7 @@ internal class DescriptorFullClassHierarchyBuilder : FullClassHierarchyBuilder {
// is not enough since it keeps only one level of hierarchy
documentable.sources.forEach { (sourceSet, source) ->
if (source is DescriptorDocumentableSource) {
- val descriptor = source.descriptor as ClassDescriptor
+ val descriptor = source.descriptor as? ClassifierDescriptorWithTypeParameters ?: return@forEach // it can be typealias as well
val type = descriptor.defaultType
hierarchy[sourceSet]?.let { collectSupertypesFromKotlinType(documentable.dri to type, it) }
} else if (source is PsiDocumentableSource) {