FIR: Add workaround for OverloadResolutionByLambdaReturnType

Mostly, that should help for existing flatMap usages

^KT-43129 Submitted
This commit is contained in:
Denis Zharkov
2020-11-02 20:45:39 +03:00
parent 07ed89b02b
commit 4612f26bfb
19 changed files with 87 additions and 209 deletions
@@ -1,10 +0,0 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
// WITH_RUNTIME
fun <T> List<Option<T>>.flatten(): List<T> = <!AMBIGUITY!>flatMap<!> { <!UNRESOLVED_REFERENCE!>it<!>.<!NONE_APPLICABLE!>fold<!>(::emptyList, <!UNRESOLVED_REFERENCE!>::listOf<!>) }
class Option<out T> {
fun <R> fold(ifEmpty: () -> R, ifSome: (T) -> R): R = TODO()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
// WITH_RUNTIME