aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/model
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/model')
-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))