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
@@ -13,7 +13,7 @@ fun atLeastOnce(x: () -> Unit) {
}
fun exactlyOnce(x: () -> Unit) {
contract { callsInPlace(x, InvocationKind.AT_LEAST_ONCE) }
contract { callsInPlace(x, InvocationKind.EXACTLY_ONCE) }
x()
}
@@ -30,6 +30,14 @@ fun test1() {
x.<!UNRESOLVED_REFERENCE!>inc<!>()
}
fun test1m() {
var x: Any?
x = ""
x.length
unknown { x = "" }
x.<!UNRESOLVED_REFERENCE!>length<!>
}
fun test2() {
var x: Any?
x = ""