diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/model/additionalExtras.kt | 2 | ||||
-rw-r--r-- | core/src/main/kotlin/model/ancestryNode.kt | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/core/src/main/kotlin/model/additionalExtras.kt b/core/src/main/kotlin/model/additionalExtras.kt index bc9135dd..d708d137 100644 --- a/core/src/main/kotlin/model/additionalExtras.kt +++ b/core/src/main/kotlin/model/additionalExtras.kt @@ -123,4 +123,4 @@ data class ConstructorValues(val values: SourceSetDependent<List<Expression>>) : } override val key: ExtraProperty.Key<DEnumEntry, ConstructorValues> = ConstructorValues -}
\ No newline at end of file +} diff --git a/core/src/main/kotlin/model/ancestryNode.kt b/core/src/main/kotlin/model/ancestryNode.kt new file mode 100644 index 00000000..5c3c077b --- /dev/null +++ b/core/src/main/kotlin/model/ancestryNode.kt @@ -0,0 +1,14 @@ +package org.jetbrains.dokka.model + +data class AncestryNode( + val typeConstructor: TypeConstructor, + val superclass: AncestryNode?, + val interfaces: List<AncestryNode>, +) { + fun allImplementedInterfaces(): List<TypeConstructor> { + fun traverseInterfaces(ancestry: AncestryNode): List<TypeConstructor> = + ancestry.interfaces.flatMap { listOf(it.typeConstructor) + traverseInterfaces(it) } + + (ancestry.superclass?.let(::traverseInterfaces) ?: emptyList()) + return traverseInterfaces(this).distinct() + } +} |