diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-08-12 14:26:45 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-17 11:55:35 +0200 |
commit | 785d741790f653d5c260f59c9d8875bbfde2dc07 (patch) | |
tree | 9c5bac1028d4ddeffb9101e1776563f1882d5ccb /core/src | |
parent | 09004d828b5640b1471309f9e537ca64a28affd3 (diff) | |
download | dokka-785d741790f653d5c260f59c9d8875bbfde2dc07.tar.gz dokka-785d741790f653d5c260f59c9d8875bbfde2dc07.tar.bz2 dokka-785d741790f653d5c260f59c9d8875bbfde2dc07.zip |
Fix generic supertypes to hold TypeParameters
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/links/DRI.kt | 2 | ||||
-rw-r--r-- | core/src/main/kotlin/model/Documentable.kt | 15 | ||||
-rw-r--r-- | core/src/main/kotlin/model/documentableProperties.kt | 2 |
3 files changed, 9 insertions, 10 deletions
diff --git a/core/src/main/kotlin/links/DRI.kt b/core/src/main/kotlin/links/DRI.kt index 4a555e71..e73c2faa 100644 --- a/core/src/main/kotlin/links/DRI.kt +++ b/core/src/main/kotlin/links/DRI.kt @@ -101,5 +101,3 @@ fun DriTarget.nextTarget(): DriTarget = when (this) { is PointingToCallableParameters -> PointingToCallableParameters(this.parameterIndex + 1) else -> this } - -data class DriWithKind(val dri: DRI, val kind: ClassKind) diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index c0289fd3..87d35e1b 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -2,7 +2,6 @@ package org.jetbrains.dokka.model import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.links.DriWithKind import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.properties.WithExtraProperties @@ -77,7 +76,7 @@ interface WithGenerics { } interface WithSupertypes { - val supertypes: SourceSetDependent<List<DriWithKind>> + val supertypes: SourceSetDependent<List<TypeConstructorWithKind>> } interface Callable : WithVisibility, WithType, WithAbstraction, WithExpectActual { @@ -130,7 +129,7 @@ data class DClass( override val visibility: SourceSetDependent<Visibility>, override val companion: DObject?, override val generics: List<DTypeParameter>, - override val supertypes: SourceSetDependent<List<DriWithKind>>, + override val supertypes: SourceSetDependent<List<TypeConstructorWithKind>>, override val documentation: SourceSetDependent<DocumentationNode>, override val expectPresentInSet: DokkaSourceSet?, override val modifier: SourceSetDependent<Modifier>, @@ -158,7 +157,7 @@ data class DEnum( override val visibility: SourceSetDependent<Visibility>, override val companion: DObject?, override val constructors: List<DFunction>, - override val supertypes: SourceSetDependent<List<DriWithKind>>, + override val supertypes: SourceSetDependent<List<TypeConstructorWithKind>>, override val sourceSets: Set<DokkaSourceSet>, override val extra: PropertyContainer<DEnum> = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties<DEnum> { @@ -219,7 +218,7 @@ data class DInterface( override val visibility: SourceSetDependent<Visibility>, override val companion: DObject?, override val generics: List<DTypeParameter>, - override val supertypes: SourceSetDependent<List<DriWithKind>>, + override val supertypes: SourceSetDependent<List<TypeConstructorWithKind>>, override val sourceSets: Set<DokkaSourceSet>, override val extra: PropertyContainer<DInterface> = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithGenerics, WithSupertypes, WithExtraProperties<DInterface> { @@ -239,7 +238,7 @@ data class DObject( override val properties: List<DProperty>, override val classlikes: List<DClasslike>, override val visibility: SourceSetDependent<Visibility>, - override val supertypes: SourceSetDependent<List<DriWithKind>>, + override val supertypes: SourceSetDependent<List<TypeConstructorWithKind>>, override val sourceSets: Set<DokkaSourceSet>, override val extra: PropertyContainer<DObject> = PropertyContainer.empty() ) : DClasslike(), WithSupertypes, WithExtraProperties<DObject> { @@ -344,7 +343,7 @@ data class DTypeAlias( sealed class Projection sealed class Bound : Projection() -data class OtherParameter(val declarationDRI: DRI, val name: String) : Bound() +data class TypeParameter(val declarationDRI: DRI, val name: String) : Bound() object Star : Projection() data class TypeConstructor( val dri: DRI, @@ -398,3 +397,5 @@ fun <T> SourceSetDependent<T>?.orEmpty(): SourceSetDependent<T> = this ?: emptyM interface DocumentableSource { val path: String } + +data class TypeConstructorWithKind(val typeConstructor: TypeConstructor, val kind: ClassKind) diff --git a/core/src/main/kotlin/model/documentableProperties.kt b/core/src/main/kotlin/model/documentableProperties.kt index cd6a9335..4eb36599 100644 --- a/core/src/main/kotlin/model/documentableProperties.kt +++ b/core/src/main/kotlin/model/documentableProperties.kt @@ -17,7 +17,7 @@ data class InheritedFunction(val inheritedFrom: SourceSetDependent<DRI?>) : Extr override val key: ExtraProperty.Key<DFunction, *> = InheritedFunction } -data class ImplementedInterfaces(val interfaces: SourceSetDependent<List<DRI>>) : ExtraProperty<Documentable> { +data class ImplementedInterfaces(val interfaces: SourceSetDependent<List<TypeConstructor>>) : ExtraProperty<Documentable> { companion object : ExtraProperty.Key<Documentable, ImplementedInterfaces> { override fun mergeStrategyFor(left: ImplementedInterfaces, right: ImplementedInterfaces) = MergeStrategy.Replace(ImplementedInterfaces(left.interfaces + right.interfaces)) |