diff options
author | Paweł Marks <pmarks@virtuslab.com> | 2020-08-13 20:35:50 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-14 14:16:41 +0200 |
commit | 892b92887ec3429833fac6378f8f93698945f897 (patch) | |
tree | cc492751c7065d615e37ccae6b1d4b4db5fca829 /plugins/base | |
parent | 0a2a5896ece71f9d37930274c86b09a5fdf38644 (diff) | |
download | dokka-892b92887ec3429833fac6378f8f93698945f897.tar.gz dokka-892b92887ec3429833fac6378f8f93698945f897.tar.bz2 dokka-892b92887ec3429833fac6378f8f93698945f897.zip |
Omit trivial bound
Diffstat (limited to 'plugins/base')
-rw-r--r-- | plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt | 9 |
1 files changed, 6 insertions, 3 deletions
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<Bound> + get() = bounds.filterNot { it is Nullable && it.inner.driOrNull == DriOfAny } + val TypeConstructor.function get() = modifier == FunctionModifiers.FUNCTION || modifier == FunctionModifiers.EXTENSION |