KT-2960 Perform control flow checks for package property initializers

#KT-2960 fixed
This commit is contained in:
Svetlana Isakova
2012-12-14 18:27:33 +04:00
parent 51c38d4cd3
commit f697098fb4
4 changed files with 49 additions and 4 deletions
@@ -0,0 +1,27 @@
//KT-2960 Perform control flow checks for package property initializers
package b
class P {
var x : Int = 0
private set
}
val p = P()
var f = { -> <!INVISIBLE_SETTER!>p.x<!> = 32 }
val o = object {
fun run() {
<!INVISIBLE_SETTER!>p.x<!> = 4
val z : Int
doSmth(<!UNINITIALIZED_VARIABLE, UNINITIALIZED_VARIABLE!>z<!>)
}
}
val g = { ->
val x: Int
doSmth(<!UNINITIALIZED_VARIABLE!>x<!>)
}
fun doSmth(i: Int) = i