K2 Scripting: fix CFG processing related testdata in compiler

This commit is contained in:
Ilya Chernikov
2023-11-22 16:56:35 +01:00
committed by Space Team
parent ff4f30ddc1
commit 90a7f7beac
10 changed files with 653 additions and 247 deletions
@@ -24,18 +24,18 @@ fun <T> inPlaceDelegate(block: () -> T): ReadOnlyProperty<Any?, T> {
fun <T> notInPlaceDelegate(block: () -> T): ReadOnlyProperty<Any?, T> = null!!
val a: String = a
val b: String = inPlaceRun { b }
val a: String = <!UNINITIALIZED_VARIABLE!>a<!>
val b: String = inPlaceRun { <!UNINITIALIZED_VARIABLE!>b<!> }
val c: String = notInPlaceRun { c }
val d: String by simpleDelegate(d)
val d: String by simpleDelegate(<!UNINITIALIZED_VARIABLE!>d<!>)
val e: String by inPlaceDelegate { e }
val f: String by notInPlaceDelegate { f }
<!MUST_BE_INITIALIZED!>val g: Int<!>
val g: Int
val h = 1.also { <!VAL_REASSIGNMENT!>g<!> = 2 }
<!MUST_BE_INITIALIZED!>val i: Int<!>
val j by lazy { <!VAL_REASSIGNMENT!>i<!> = 2; 1 }
val j by lazy { <!CAPTURED_VAL_INITIALIZATION, VAL_REASSIGNMENT!>i<!> = 2; 1 }
val k: Int
get() {
<!VAL_REASSIGNMENT!>i<!> = 3
@@ -46,13 +46,13 @@ val l: Comparator<String> = object : Comparator<String> {
val delegate: Comparator<String> get() = n
override fun compare(o1: String, o2: String): Int = delegate.compare(o1, o2)
}
val m: Comparator<String> = object : Comparator<String> by n {}
val m: Comparator<String> = object : Comparator<String> by <!UNINITIALIZED_VARIABLE!>n<!> {}
val n: Comparator<String> = Comparator { _, _ -> 0 }
val t: String = z
val u: String = inPlaceRun { z }
val t: String = <!UNINITIALIZED_VARIABLE!>z<!>
val u: String = inPlaceRun { <!UNINITIALIZED_VARIABLE!>z<!> }
val v: String = notInPlaceRun { z }
val w: String by simpleDelegate(z)
val w: String by simpleDelegate(<!UNINITIALIZED_VARIABLE!>z<!>)
val x: String by inPlaceDelegate { z }
val y: String by notInPlaceDelegate { z }
val z: String = "VALUE"