aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/translators/documentables/DescriptionSections.kt
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-07-05 10:04:55 +0200
committerGitHub <noreply@github.com>2023-07-05 10:04:55 +0200
commit9559158bfeeb274e9ccf1b4563f1b23b42afc493 (patch)
tree3ece0887623cfe2b7148af23001867a1dd5e6597 /plugins/base/src/main/kotlin/translators/documentables/DescriptionSections.kt
parentcbd9733d3dd2f52992e98e7cebd072091a572529 (diff)
downloaddokka-9559158bfeeb274e9ccf1b4563f1b23b42afc493.tar.gz
dokka-9559158bfeeb274e9ccf1b4563f1b23b42afc493.tar.bz2
dokka-9559158bfeeb274e9ccf1b4563f1b23b42afc493.zip
Decompose Kotlin/Java analysis (#3034)
* Extract analysis into separate modules
Diffstat (limited to 'plugins/base/src/main/kotlin/translators/documentables/DescriptionSections.kt')
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DescriptionSections.kt14
1 files changed, 9 insertions, 5 deletions
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<WithExtraProperties<Documentable>>()
- ?.let { it.extra[InheritorsInfo] }
- ?.let { inheritors -> inheritors.value.filter { it.value.isNotEmpty() } }
- .orEmpty()
+private fun WithScope.inheritors(): SourceSetDependent<List<DRI>> {
+ @Suppress("UNCHECKED_CAST")
+ val withExtra = this as? WithExtraProperties<Documentable>
+
+ 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