aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2023-07-03 16:18:43 +0300
committerGitHub <noreply@github.com>2023-07-03 16:18:43 +0300
commitcbd9733d3dd2f52992e98e7cebd072091a572529 (patch)
treed7142fb1c8b83b9f4c2d8abb873f8847c427a0d5 /core/src
parent12a386bb7185f862a1cbd831e6856c4235953833 (diff)
downloaddokka-cbd9733d3dd2f52992e98e7cebd072091a572529.tar.gz
dokka-cbd9733d3dd2f52992e98e7cebd072091a572529.tar.bz2
dokka-cbd9733d3dd2f52992e98e7cebd072091a572529.zip
Enhance typealias presentation (#3053)
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/model/Documentable.kt3
-rw-r--r--core/src/main/kotlin/model/additionalExtras.kt15
2 files changed, 14 insertions, 4 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt
index adc51cfc..c7b2290e 100644
--- a/core/src/main/kotlin/model/Documentable.kt
+++ b/core/src/main/kotlin/model/Documentable.kt
@@ -376,8 +376,9 @@ data class DTypeAlias(
override val expectPresentInSet: DokkaSourceSet?,
override val sourceSets: Set<DokkaSourceSet>,
override val generics: List<DTypeParameter>,
+ override val sources: SourceSetDependent<DocumentableSource>,
override val extra: PropertyContainer<DTypeAlias> = PropertyContainer.empty()
-) : Documentable(), WithType, WithVisibility, WithExtraProperties<DTypeAlias>, WithGenerics {
+) : Documentable(), WithType, WithVisibility, WithExtraProperties<DTypeAlias>, WithGenerics, WithSources {
override val children: List<Nothing>
get() = emptyList()
diff --git a/core/src/main/kotlin/model/additionalExtras.kt b/core/src/main/kotlin/model/additionalExtras.kt
index 9b98448e..1f6f6d27 100644
--- a/core/src/main/kotlin/model/additionalExtras.kt
+++ b/core/src/main/kotlin/model/additionalExtras.kt
@@ -104,13 +104,22 @@ object PrimaryConstructorExtra : ExtraProperty<DFunction>, ExtraProperty.Key<DFu
override val key: ExtraProperty.Key<DFunction, *> = this
}
-data class ActualTypealias(val underlyingType: SourceSetDependent<Bound>) : ExtraProperty<DClasslike> {
+data class ActualTypealias(
+ val typeAlias: DTypeAlias
+) : ExtraProperty<DClasslike> {
+
+ @Suppress("unused")
+ @Deprecated(message = "It can be removed soon. Use [typeAlias.underlyingType]", ReplaceWith("this.typeAlias.underlyingType"))
+ val underlyingType: SourceSetDependent<Bound>
+ get() = typeAlias.underlyingType
+
companion object : ExtraProperty.Key<DClasslike, ActualTypealias> {
override fun mergeStrategyFor(
left: ActualTypealias,
right: ActualTypealias
- ) =
- MergeStrategy.Replace(ActualTypealias(left.underlyingType + right.underlyingType))
+ ) = MergeStrategy.Fail {
+ throw IllegalStateException("Adding [ActualTypealias] should be after merging all documentables")
+ }
}
override val key: ExtraProperty.Key<DClasslike, ActualTypealias> = ActualTypealias