Temp workaround: force out-of-block modification for properties with nullable types
Initializers for properties with nullable types are analyzed with binding context common for all declarations. This can cause invalid elements are left in the cache guarded with out-of-block modification tracker. This workaround forces increment for such cases.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// FALSE
|
||||
// TRUE
|
||||
class Test {
|
||||
val a : () -> Int = { <caret>pri }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// TRUE
|
||||
|
||||
// Problem with lazy initialization of nullable properties
|
||||
trait Some
|
||||
|
||||
val test: Some = object: Some {
|
||||
fun test() {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// TRUE
|
||||
|
||||
// Problem with lazy initialization of nullable properties
|
||||
|
||||
val test: Int? = if (true) {
|
||||
fun test() {
|
||||
val t<caret>
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// TRUE
|
||||
|
||||
// Problem with lazy initialization of nullable properties
|
||||
trait Some
|
||||
|
||||
val test: Some? = object: Some {
|
||||
fun test() {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
// FALSE
|
||||
// TRUE
|
||||
|
||||
val test: String = "<caret>"
|
||||
Reference in New Issue
Block a user