FIR DFA: add more called-in-place tests

This commit is contained in:
pyos
2022-11-17 00:05:43 +01:00
committed by teamcity
parent f485413cfd
commit 3392e066df
9 changed files with 1928 additions and 639 deletions
@@ -71,3 +71,19 @@ fun test5(x: Any?, q: String?) {
p<!UNSAFE_CALL!>.<!>length // Bad: p is String? | (String? & Int) = String?
p?.length // OK: p is String?
}
fun test6() {
val x: String
// not necessarily initialized in second lambda (may call in any order)
run2({ x = ""; x.length }, { x.length })
x.length // initialized here
}
fun test7() {
val x: Any? = ""
val y: Any?
run2({ y = x }, { })
if (y is String) {
x.<!UNRESOLVED_REFERENCE!>length<!> // ok - aliased
}
}