From 892b92887ec3429833fac6378f8f93698945f897 Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Thu, 13 Aug 2020 20:35:50 +0200 Subject: Omit trivial bound --- .../base/src/main/kotlin/signatures/KotlinSignatureProvider.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'plugins/base') diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index 8341fabd..88879d81 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -155,7 +155,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog } link(c.name!!, c.dri) if (c is WithGenerics) { - list(c.generics, prefix = "<", suffix = "> ") { + list(c.generics, prefix = "<", suffix = ">") { +buildSignature(it) } } @@ -292,8 +292,8 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog t.sourceSets.map { contentBuilder.contentFor(t, styles = t.stylesIfDeprecated(it), sourceSets = setOf(it)) { link(t.name, t.dri.withTargetToDeclaration()) - list(t.bounds, prefix = " : ") { - signatureForProjection(it) + list(t.nontrivialBounds, prefix = " : ") { bound -> + signatureForProjection(bound) } } } @@ -375,6 +375,9 @@ private fun PrimitiveJavaType.translateToKotlin() = TypeConstructor( projections = emptyList() ) +private val DTypeParameter.nontrivialBounds: List + get() = bounds.filterNot { it is Nullable && it.inner.driOrNull == DriOfAny } + val TypeConstructor.function get() = modifier == FunctionModifiers.FUNCTION || modifier == FunctionModifiers.EXTENSION -- cgit