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:
Nikolay Krasko
2014-10-21 17:49:11 +04:00
parent 5cdd5f580d
commit 798a6bf689
7 changed files with 52 additions and 7 deletions
@@ -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>"