blob: 5c3c077b292ad5fe27188bf314a7b3c8ca73f055 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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()
}
}
|