FIR: Fix builder inference case with independent calls inside lambda

This commit is contained in:
Denis.Zharkov
2021-01-29 18:51:20 +03:00
parent 29ac4cb9cc
commit e7669ef9d6
7 changed files with 82 additions and 16 deletions
@@ -0,0 +1,16 @@
// FIR_IDENTICAL
// SKIP_TXT
class A {
lateinit var m: Map<String, Int>
@ExperimentalStdlibApi
fun foo(xs: Collection<List<String>>) {
m = buildMap {
// flatMap calls might be completed on early phase
for (x in xs.flatMap { it.toList() }) {
put(x, x.length)
}
}
}
}
@@ -1,9 +0,0 @@
// ISSUE: KT-41308
fun main() {
sequence {
val list: List<String>? = null
val outputList = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.List<kotlin.String>")!>list ?: listOf()<!>
<!NONE_APPLICABLE!>yieldAll<!>(outputList)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// ISSUE: KT-41308
fun main() {