diff options
Diffstat (limited to 'dokka-subprojects/plugin-base')
-rw-r--r-- | dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt b/dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt index 9b646f24..c8a18788 100644 --- a/dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt +++ b/dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt @@ -4,6 +4,7 @@ package model +import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.PointingToDeclaration @@ -27,6 +28,48 @@ class MultiLanguageInheritanceTest : BaseAbstractTest() { } @Test + fun `should not try to find javadoc for non JVM source set`() { + // Bug #3209 is actual for Dokka K1 + // Technical note: `KtPropertyAccessor`, i.e. `<get-withHintType>`, is not KtCallableDeclaration so `findKDoc` returns null + // Meanwhile, `getJavaDocs()` for KtPropertyAccessor tries to unexpectedly parse the KDoc documentation of property, i.e. `withHintType` + + val nonJvmConfiguration = dokkaConfiguration { + suppressObviousFunctions = false + sourceSets { + sourceSet { + analysisPlatform = Platform.common.key + sourceRoots = listOf("src/main/kotlin") + } + } + } + + testInline( + """ + |/src/main/kotlin/sample/Parent.kt + |package sample + | + |/** + | * Sample description from parent + | */ + |interface Parent { + | /** + | * Sample description from parent + | */ + | val withHintType: String + |} + | + |/src/main/kotlin/sample/Child.kt + |package sample + |public class Child : Parent { + | override val withHintType: String + | get() = "" + |} + """.trimIndent(), + nonJvmConfiguration + ) { } + } + + @Test fun `from java to kotlin`() { testInline( """ |