Resolve lateinit variables

Do not report UNINITIALIZED_VARIABLE on lateinit variables
Provide delegating constructors for descriptors for compatibility.
This commit is contained in:
Dmitry Petrov
2017-05-31 13:52:07 +03:00
parent f88cd5ed3d
commit 3bae430d49
19 changed files with 86 additions and 13 deletions
@@ -0,0 +1,22 @@
fun test1() {
lateinit var s: String
s.length
}
fun test2() {
lateinit var s: String
run {
s = ""
}
s.length
}
fun almostAlwaysTrue(): Boolean = true
fun test3() {
lateinit var s: String
if (almostAlwaysTrue()) {
s = ""
}
s.length
}
@@ -0,0 +1,6 @@
package
public fun almostAlwaysTrue(): kotlin.Boolean
public fun test1(): kotlin.Unit
public fun test2(): kotlin.Unit
public fun test3(): kotlin.Unit