blob: 0a1038b91a37688d7ae736eced0d9984d5a79ce1 [file]
// RUN_PIPELINE_TILL: FRONTEND
//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!>z<!>)
}
}
val g = { ->
val x: Int
doSmth(<!UNINITIALIZED_VARIABLE!>x<!>)
}
class A {
val a : Int = 1
get() {
val x : Int
doSmth(<!UNINITIALIZED_VARIABLE!>x<!>)
return field
}
}
fun doSmth(i: Int) = i
/* GENERATED_FIR_TAGS: anonymousObjectExpression, assignment, classDeclaration, functionDeclaration, getter,
integerLiteral, lambdaLiteral, localProperty, propertyDeclaration */