aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin/DocumentationBuilder.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Kotlin/DocumentationBuilder.kt')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 40c6d745..892a462e 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -71,7 +71,14 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
}
fun DocumentationNode.appendModality(descriptor: MemberDescriptor) {
- val modifier = descriptor.getModality().name().toLowerCase()
+ var modality = descriptor.getModality()
+ if (modality == Modality.OPEN) {
+ val containingClass = descriptor.getContainingDeclaration() as? ClassDescriptor
+ if (containingClass?.getModality() == Modality.FINAL) {
+ modality = Modality.FINAL
+ }
+ }
+ val modifier = modality.name().toLowerCase()
val node = DocumentationNode(modifier, Content.Empty, DocumentationNode.Kind.Modifier)
append(node, DocumentationReference.Kind.Detail)
}