From 785d741790f653d5c260f59c9d8875bbfde2dc07 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Wed, 12 Aug 2020 14:26:45 +0200 Subject: Fix generic supertypes to hold TypeParameters --- core/src/main/kotlin/links/DRI.kt | 2 -- core/src/main/kotlin/model/Documentable.kt | 15 ++++++++------- core/src/main/kotlin/model/documentableProperties.kt | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'core') 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> + val supertypes: SourceSetDependent> } interface Callable : WithVisibility, WithType, WithAbstraction, WithExpectActual { @@ -130,7 +129,7 @@ data class DClass( override val visibility: SourceSetDependent, override val companion: DObject?, override val generics: List, - override val supertypes: SourceSetDependent>, + override val supertypes: SourceSetDependent>, override val documentation: SourceSetDependent, override val expectPresentInSet: DokkaSourceSet?, override val modifier: SourceSetDependent, @@ -158,7 +157,7 @@ data class DEnum( override val visibility: SourceSetDependent, override val companion: DObject?, override val constructors: List, - override val supertypes: SourceSetDependent>, + override val supertypes: SourceSetDependent>, override val sourceSets: Set, override val extra: PropertyContainer = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties { @@ -219,7 +218,7 @@ data class DInterface( override val visibility: SourceSetDependent, override val companion: DObject?, override val generics: List, - override val supertypes: SourceSetDependent>, + override val supertypes: SourceSetDependent>, override val sourceSets: Set, override val extra: PropertyContainer = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithGenerics, WithSupertypes, WithExtraProperties { @@ -239,7 +238,7 @@ data class DObject( override val properties: List, override val classlikes: List, override val visibility: SourceSetDependent, - override val supertypes: SourceSetDependent>, + override val supertypes: SourceSetDependent>, override val sourceSets: Set, override val extra: PropertyContainer = PropertyContainer.empty() ) : DClasslike(), WithSupertypes, WithExtraProperties { @@ -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 SourceSetDependent?.orEmpty(): SourceSetDependent = 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) : Extr override val key: ExtraProperty.Key = InheritedFunction } -data class ImplementedInterfaces(val interfaces: SourceSetDependent>) : ExtraProperty { +data class ImplementedInterfaces(val interfaces: SourceSetDependent>) : ExtraProperty { companion object : ExtraProperty.Key { override fun mergeStrategyFor(left: ImplementedInterfaces, right: ImplementedInterfaces) = MergeStrategy.Replace(ImplementedInterfaces(left.interfaces + right.interfaces)) -- cgit