diff options
Diffstat (limited to 'plugins/base')
3 files changed, 27 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 3dc2385a..04716e16 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -420,9 +420,8 @@ private class DokkaDescriptorVisitor( originalDescriptor: PropertyDescriptor, parent: DRIWithPlatformInfo ): DProperty { - val dri = parent.dri.copy(callable = Callable.from(originalDescriptor)) + val (dri, inheritedFrom) = originalDescriptor.createDRI() val descriptor = originalDescriptor.getConcreteDescriptor() - val inheritedFrom = descriptor.createDRI().let { (originalDri, _) -> originalDri.takeIf { it != dri } } val isExpect = descriptor.isExpect val isActual = descriptor.isActual diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 4b5fc1c0..5494e5e7 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -51,7 +51,7 @@ open class DefaultPageCreator( e.nameAfterClash(), contentForEnumEntry(e), setOf(e.dri), e, e.classlikes.renameClashingDocumentable().map(::pageForClasslike) + e.filteredFunctions.renameClashingDocumentable().map(::pageForFunction) + - e.properties.renameClashingDocumentable().mapNotNull(::pageForProperty) + e.filteredProperties.renameClashingDocumentable().mapNotNull(::pageForProperty) ) open fun pageForClasslike(c: DClasslike): ClasslikePageNode { diff --git a/plugins/base/src/test/kotlin/model/PropertyTest.kt b/plugins/base/src/test/kotlin/model/PropertyTest.kt index 8474116f..17f526f3 100644 --- a/plugins/base/src/test/kotlin/model/PropertyTest.kt +++ b/plugins/base/src/test/kotlin/model/PropertyTest.kt @@ -121,6 +121,7 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro ) { with((this / "property").cast<DPackage>()) { with((this / "Foo" / "property").cast<DProperty>()) { + dri.classNames equals "Foo" name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { @@ -128,6 +129,30 @@ class PropertyTest : AbstractModelTest("/src/main/kotlin/property/Test.kt", "pro } } with((this / "Bar" / "property").cast<DProperty>()) { + dri.classNames equals "Bar" + name equals "property" + children counts 0 + with(getter.assertNotNull("Getter")) { + type.name equals "Int" + } + } + } + } + } + + @Test + fun propertyInherited() { + inlineModelTest( + """ + |open class Foo() { + | open val property: Int get() = 0 + |} + |class Bar(): Foo() + """ + ) { + with((this / "property").cast<DPackage>()) { + with((this / "Bar" / "property").cast<DProperty>()) { + dri.classNames equals "Foo" name equals "property" children counts 0 with(getter.assertNotNull("Getter")) { |