FIR CFG: filter out variables declared inside lambdas more eagerly

This commit is contained in:
pyos
2022-10-12 09:47:49 +02:00
committed by teamcity
parent 090aec6b3b
commit 2ec264cfa2
4 changed files with 52 additions and 35 deletions
@@ -1,4 +1,5 @@
// ISSUE: KT-50092
// SKIP_TXT
fun test1() {
var x: String? = "..."
@@ -53,3 +54,15 @@ fun test4() {
lambda?.invoke()
}
}
fun test5() {
var lambda: (() -> Int)? = null
for (i in 1..2) {
lambda = {
var x: String?
x = ""
<!DEBUG_INFO_SMARTCAST!>x<!>.length // ok
}
}
lambda?.invoke()
}