09b44b3189
#KT-40254 Fixed
10 lines
258 B
Kotlin
Vendored
10 lines
258 B
Kotlin
Vendored
// !LANGUAGE: +NewInference
|
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
// WITH_RUNTIME
|
|
|
|
|
|
fun <T> List<Option<T>>.flatten(): List<T> = flatMap { it.fold(::emptyList, ::listOf) }
|
|
|
|
class Option<out T> {
|
|
fun <R> fold(ifEmpty: () -> R, ifSome: (T) -> R): R = TODO()
|
|
} |