aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/Kotlin/DocumentationBuilder.kt2
-rw-r--r--core/src/test/kotlin/model/ClassTest.kt10
2 files changed, 11 insertions, 1 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
index b034a299..4dae3a54 100644
--- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
@@ -548,7 +548,7 @@ class DocumentationBuilder
.mapTo(result) { ClassMember(it, extraModifier = "static") }
val companionObjectDescriptor = companionObjectDescriptor
- if (companionObjectDescriptor != null) {
+ if (companionObjectDescriptor != null && companionObjectDescriptor.isDocumented(options)) {
val descriptors = companionObjectDescriptor.defaultType.memberScope.getContributedDescriptors()
val descriptorsToDocument = descriptors.filter { it !is CallableDescriptor || !it.isInheritedFromAny() }
descriptorsToDocument.mapTo(result) {
diff --git a/core/src/test/kotlin/model/ClassTest.kt b/core/src/test/kotlin/model/ClassTest.kt
index fb225728..f8baf251 100644
--- a/core/src/test/kotlin/model/ClassTest.kt
+++ b/core/src/test/kotlin/model/ClassTest.kt
@@ -280,4 +280,14 @@ class ClassTest {
}
}
}
+
+ @Test fun privateCompanionObject() {
+ verifyModel("testdata/classes/privateCompanionObject.kt", includeNonPublic = false) { model ->
+ with(model.members.single().members.single()) {
+ assertEquals(0, members(NodeKind.CompanionObjectFunction).size)
+ assertEquals(0, members(NodeKind.CompanionObjectProperty).size)
+ }
+ }
+ }
+
}