Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/resolve/resolveTwoReferencesAgainstGenerics.kt
T
2020-07-14 13:05:28 +03:00

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()
}