Resolve lateinit variables
Do not report UNINITIALIZED_VARIABLE on lateinit variables Provide delegating constructors for descriptors for compatibility.
This commit is contained in:
+22
@@ -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
|
||||
}
|
||||
+6
@@ -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
|
||||
Reference in New Issue
Block a user