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 /plugins/kotlin-as-java/src/main/kotlin | |
parent | 09004d828b5640b1471309f9e537ca64a28affd3 (diff) | |
download | dokka-785d741790f653d5c260f59c9d8875bbfde2dc07.tar.gz dokka-785d741790f653d5c260f59c9d8875bbfde2dc07.tar.bz2 dokka-785d741790f653d5c260f59c9d8875bbfde2dc07.zip |
Fix generic supertypes to hold TypeParameters
Diffstat (limited to 'plugins/kotlin-as-java/src/main/kotlin')
-rw-r--r-- | plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt | 7 | ||||
-rw-r--r-- | plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt index e66266a2..58c62622 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt @@ -257,6 +257,7 @@ internal fun String.getAsPrimitive(): JvmPrimitiveType? = org.jetbrains.kotlin.b private fun DRI.partialFqName() = packageName?.let { "$it." } + classNames private fun DRI.possiblyAsJava() = this.partialFqName().mapToJava()?.toDRI(this) ?: this +private fun TypeConstructor.possiblyAsJava() = copy(dri = this.dri.possiblyAsJava()) private fun String.mapToJava(): ClassId? = JavaToKotlinClassMap.mapKotlinToJava(FqName(this).toUnsafe()) @@ -269,9 +270,9 @@ internal fun ClassId.toDRI(dri: DRI?): DRI = DRI( target = PointingToDeclaration ) -internal fun DriWithKind.asJava(): DriWithKind = - DriWithKind( - dri = dri.possiblyAsJava(), +internal fun TypeConstructorWithKind.asJava(): TypeConstructorWithKind = + TypeConstructorWithKind( + typeConstructor = typeConstructor.possiblyAsJava(), kind = kind.asJava() ) diff --git a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt index 158dda22..efb7b739 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt @@ -79,10 +79,10 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge c.supertypes.map { (p, dris) -> val (classes, interfaces) = dris.partition { it.kind == JavaClassKindTypes.CLASS } list(classes, prefix = " extends ", sourceSets = setOf(p)) { - link(it.dri.sureClassNames, it.dri, sourceSets = setOf(p)) + link(it.typeConstructor.dri.sureClassNames, it.typeConstructor.dri, sourceSets = setOf(p)) } list(interfaces, prefix = " implements ", sourceSets = setOf(p)){ - link(it.dri.sureClassNames, it.dri, sourceSets = setOf(p)) + link(it.typeConstructor.dri.sureClassNames, it.typeConstructor.dri, sourceSets = setOf(p)) } } } @@ -149,7 +149,7 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge } private fun PageContentBuilder.DocumentableContentBuilder.signatureForProjection(p: Projection): Unit = when (p) { - is OtherParameter -> link(p.name, p.declarationDRI) + is TypeParameter -> link(p.name, p.declarationDRI) is TypeConstructor -> group(styles = emptySet()) { link(p.dri.classNames.orEmpty(), p.dri) |