From 9559158bfeeb274e9ccf1b4563f1b23b42afc493 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Wed, 5 Jul 2023 10:04:55 +0200 Subject: Decompose Kotlin/Java analysis (#3034) * Extract analysis into separate modules --- .../translators/documentables/DescriptionSections.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'plugins/base/src/main/kotlin/translators/documentables/DescriptionSections.kt') diff --git a/plugins/base/src/main/kotlin/translators/documentables/DescriptionSections.kt b/plugins/base/src/main/kotlin/translators/documentables/DescriptionSections.kt index 35645a73..6c5d885d 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DescriptionSections.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DescriptionSections.kt @@ -16,7 +16,6 @@ import org.jetbrains.dokka.pages.ContentKind import org.jetbrains.dokka.pages.ContentStyle import org.jetbrains.dokka.pages.TextStyle import org.jetbrains.dokka.utilities.DokkaLogger -import org.jetbrains.kotlin.utils.addToStdlib.safeAs import kotlin.reflect.KClass import kotlin.reflect.full.isSubclassOf @@ -250,10 +249,15 @@ internal fun PageContentBuilder.DocumentableContentBuilder.inheritorsSectionCont multiplatformInheritorsSectionContent(documentable, inheritors, logger) } -private fun WithScope.inheritors() = safeAs>() - ?.let { it.extra[InheritorsInfo] } - ?.let { inheritors -> inheritors.value.filter { it.value.isNotEmpty() } } - .orEmpty() +private fun WithScope.inheritors(): SourceSetDependent> { + @Suppress("UNCHECKED_CAST") + val withExtra = this as? WithExtraProperties + + return withExtra + ?.let { it.extra[InheritorsInfo] } + ?.let { inheritors -> inheritors.value.filter { it.value.isNotEmpty() } } + .orEmpty() +} /** * Detect that documentable is located only in the shared code without expect-actuals -- cgit