Use of uninitialized variables in lambdas / object literals / local functions is forbidden now #KT-4475 Fixed
Local declarations CFA: variable initialization information before them is now taken into account
This commit is contained in:
+3
-2
@@ -1,8 +1,9 @@
|
||||
object RefreshQueue {
|
||||
val any = Any()
|
||||
val workerThread: Thread = Thread(object : Runnable {
|
||||
override fun run() {
|
||||
val a = workerThread
|
||||
val b = RefreshQueue.workerThread
|
||||
val a = any
|
||||
val b = RefreshQueue.any
|
||||
if (a != b) throw AssertionError()
|
||||
}
|
||||
})
|
||||
|
||||
+4
-1
@@ -1,7 +1,10 @@
|
||||
public object RefreshQueue {
|
||||
|
||||
private val any = Any()
|
||||
|
||||
private val workerThread: Thread = Thread(object : Runnable {
|
||||
override fun run() {
|
||||
workerThread.isInterrupted()
|
||||
any.hashCode()
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user