63b0708ed5
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
11 lines
241 B
Kotlin
Vendored
11 lines
241 B
Kotlin
Vendored
fun foo(y: String?) {
|
|
var x: String? = ""
|
|
if (x != null) {
|
|
with(y?.let { x = null; it }) {
|
|
this<!UNSAFE_CALL!>.<!>length
|
|
x<!UNSAFE_CALL!>.<!>length
|
|
}
|
|
x<!UNSAFE_CALL!>.<!>length
|
|
}
|
|
}
|