aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-03-10 15:30:09 +0100
committerKamil Doległo <kamilok1965@interia.pl>2020-03-11 11:30:50 +0100
commitc3d8894722c20411d56194e7529b52644307731e (patch)
treecc4003f4c05769758fbe857f30244deb793096fb /core/src/main/kotlin
parent6db83944ee6832efcbf3583d2d2b0bde13fd9d89 (diff)
downloaddokka-c3d8894722c20411d56194e7529b52644307731e.tar.gz
dokka-c3d8894722c20411d56194e7529b52644307731e.tar.bz2
dokka-c3d8894722c20411d56194e7529b52644307731e.zip
Merges documentables with the same source
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r--core/src/main/kotlin/model/Documentable.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt
index 8ff5969c..94bd624a 100644
--- a/core/src/main/kotlin/model/Documentable.kt
+++ b/core/src/main/kotlin/model/Documentable.kt
@@ -43,6 +43,11 @@ data class PlatformDependent<out T>(
val prevalentValue: T?
get() = map.values.distinct().singleOrNull()
+ val allValues: Sequence<T> = sequence {
+ expect?.also { yield(it) }
+ yieldAll(map.values)
+ }
+
companion object {
fun <T> empty(): PlatformDependent<T> = PlatformDependent(emptyMap())
fun <T> from(platformData: PlatformData, element: T) = PlatformDependent(mapOf(platformData to element))