aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-09-09 15:42:35 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-09-10 13:11:02 +0200
commita5434ae0141ac1a3d150f76937b0456ad15030e0 (patch)
treef9f01183c565a5c2ac02d451c332fb93b6fb6a7f
parent3845e64c04fa5a7fc51370bbc55aa694697919cf (diff)
downloaddokka-a5434ae0141ac1a3d150f76937b0456ad15030e0.tar.gz
dokka-a5434ae0141ac1a3d150f76937b0456ad15030e0.tar.bz2
dokka-a5434ae0141ac1a3d150f76937b0456ad15030e0.zip
Fix showing fully qualified name for typealiases with clashing names
-rw-r--r--plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt4
-rw-r--r--plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt24
2 files changed, 24 insertions, 4 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
index 08e702ba..324ef303 100644
--- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
+++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt
@@ -307,9 +307,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog
) {
signatureForProjection(
p = bound,
- showFullyQualifiedName =
- bound.driOrNull?.packageName != typeAlias.dri.packageName &&
- bound.driOrNull?.packageName != "kotlin"
+ showFullyQualifiedName = bound.driOrNull?.classNames == typeAlias.dri.classNames
)
}
diff --git a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt
index cabe822d..908109bf 100644
--- a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt
+++ b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt
@@ -448,7 +448,29 @@ class ContentForSignaturesTest : AbstractCoreTest() {
pagesTransformationStage = { module ->
val page = module.children.single { it.name == "test" } as PackagePageNode
page.content.assertNode {
- typealiasSignature("Alias", "other.X")
+ typealiasSignature("Alias", "X")
+ }
+ }
+ }
+ }
+
+ @Test
+ fun `typealias to type in different package with same name`() {
+ testInline(
+ """
+ |/src/main/kotlin/test/source.kt
+ |package test
+ |typealias Alias = other.Alias
+ |
+ |/src/main/kotlin/test/source2.kt
+ |package other
+ |class Alias
+ """.trimIndent(), testConfiguration
+ ) {
+ pagesTransformationStage = { module ->
+ val page = module.children.single { it.name == "test" } as PackagePageNode
+ page.content.assertNode {
+ typealiasSignature("Alias", "other.Alias")
}
}
}