diff options
author | Vadim Mishenev <vad-mishenev@yandex.ru> | 2023-07-03 16:18:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-03 16:18:43 +0300 |
commit | cbd9733d3dd2f52992e98e7cebd072091a572529 (patch) | |
tree | d7142fb1c8b83b9f4c2d8abb873f8847c427a0d5 /core/src/main/kotlin/model/additionalExtras.kt | |
parent | 12a386bb7185f862a1cbd831e6856c4235953833 (diff) | |
download | dokka-cbd9733d3dd2f52992e98e7cebd072091a572529.tar.gz dokka-cbd9733d3dd2f52992e98e7cebd072091a572529.tar.bz2 dokka-cbd9733d3dd2f52992e98e7cebd072091a572529.zip |
Enhance typealias presentation (#3053)
Diffstat (limited to 'core/src/main/kotlin/model/additionalExtras.kt')
-rw-r--r-- | core/src/main/kotlin/model/additionalExtras.kt | 15 |
1 files changed, 12 insertions, 3 deletions
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 |