diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-08-25 14:51:53 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-27 17:35:04 +0200 |
commit | b05eb93d345cccd0cae9393f99acd428012d1106 (patch) | |
tree | e5bbc7ec75b5b5034c3d6b3e7c9690a510150264 /plugins/kotlin-as-java | |
parent | 1c6dabaee7764954a9783effa7463f9866a02066 (diff) | |
download | dokka-b05eb93d345cccd0cae9393f99acd428012d1106.tar.gz dokka-b05eb93d345cccd0cae9393f99acd428012d1106.tar.bz2 dokka-b05eb93d345cccd0cae9393f99acd428012d1106.zip |
Add handling for generic type parameters variance
Diffstat (limited to 'plugins/kotlin-as-java')
-rw-r--r-- | plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt | 2 | ||||
-rw-r--r-- | plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt | 6 |
2 files changed, 4 insertions, 4 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 58c62622..f169f89a 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt @@ -172,7 +172,7 @@ internal fun DClass.asJava(): DClass = copy( ) private fun DTypeParameter.asJava(): DTypeParameter = copy( - dri = dri.possiblyAsJava(), + variantTypeParameter = variantTypeParameter.withNewDri(dri.possiblyAsJava()), bounds = bounds.map { it.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 5134bd4d..d9b9dc5b 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt @@ -141,7 +141,7 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge private fun signature(t: DTypeParameter) = t.sourceSets.map { contentBuilder.contentFor(t, styles = t.stylesIfDeprecated(it), sourceSets = setOf(it)) { - text(t.name.substringAfterLast(".")) + text(t.name.substringAfterLast(".")) // Investigate if java classes can be somehow variant list(t.bounds, prefix = " extends ") { signatureForProjection(it) } @@ -159,8 +159,8 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge } } - is Variance -> group(styles = emptySet()) { - text(p.kind.toString() + " ") // TODO: "super" && "extends" + is Variance<*> -> group(styles = emptySet()) { + text("$p ".takeIf { it.isNotBlank() } ?: "") // TODO: "super" && "extends" signatureForProjection(p.inner) } |