FIR CFG: join/unify data flow from postponed lambdas at each level

For example:

    foo(
        // `if` joins A & B
        if (condition)
            run { ... } // A
        else
            run { ... }, // B
        run { ... } // C
    ) // `foo` unifies `A & B` and `C`, so if it is not resolved itself,
      // further `if`s, `when`s, safe calls outside it, etc. continue
      // building the correct type predicate until the next completed
      // call.

^KT-44512 Fixed
This commit is contained in:
pyos
2022-06-13 14:17:34 +02:00
committed by teamcity
parent 755c54553a
commit 63b0708ed5
17 changed files with 720 additions and 623 deletions
@@ -6,6 +6,6 @@ fun foo(y: String?) {
var x: String? = ""
if (x != null) {
bar(y?.let { x = null; it })<!UNSAFE_CALL!>.<!>length
x.length // Smart cast is not possible
x<!UNSAFE_CALL!>.<!>length // Smart cast is not possible
}
}