Files
Brian Norman a2c9e5b36a [FIR] Copy implications from previous data flows when there is only one
Postponed lambdas introduce a host of challenges in data-flow analysis.
While inheriting type statements was disabled while these challenges are
being considered, we must still copy type statements from non-postponed
lambda edges. It seems the same is true for implications.

Implications are copied from previous flows when there is only a single
previous flow. That is because it never seemed to be required based on
test results. However, a recent test case revealed that copying is
required when there are multiple previous flows, but only one flow is
from a non-postponed-lambda node.

Combining implications from multiple non-postponed-lambda nodes did not
have an impact on test results, so until such a test case can be
created, the overhead of calculating common implications from multiple
flows will be avoided.

^KT-63351 Fixed
2024-01-30 17:22:31 +00:00

15 lines
390 B
Kotlin
Vendored

// WITH_STDLIB
// ISSUE: KT-63351
fun test1(x: List<String>?) {
// x should be non-null in arguments list, despite of a chain
x?.subList(0, <!DEBUG_INFO_SMARTCAST!>x<!>.size)?.
subList(0, <!DEBUG_INFO_SMARTCAST!>x<!>.size)?.
get(<!DEBUG_INFO_SMARTCAST!>x<!>.size)
}
fun test2(x: List<String>?) {
x?.filter { true }!!.size
<!DEBUG_INFO_SMARTCAST!>x<!>.size
}