Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/resolve/resolveTwoReferencesAgainstGenerics.kt
T
Denis Zharkov 4612f26bfb FIR: Add workaround for OverloadResolutionByLambdaReturnType
Mostly, that should help for existing flatMap usages

^KT-43129 Submitted
2020-11-03 18:30:15 +03:00

11 lines
275 B
Kotlin
Vendored

// FIR_IDENTICAL
// !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()
}