Files
kotlin/compiler/testData/diagnostics/tests/controlFlowAnalysis/propertiesInitWithOtherInstance.kt
Denis Zharkov 7d963e8e07 Differ this/non-this instances for vars initialization in class
When deal with constructed object (not this) treat it like it's fully initialized.

Otherwise (this or access with no receiver) access instruction
should be handled as it was before.

 #KT-6788 Fixed
 #KT-4126 Fixed
2015-03-11 17:45:25 +03:00

13 lines
317 B
Kotlin
Vendored

class A(val next: A? = null) {
val x: String
init {
<!VAL_REASSIGNMENT!>next?.x<!> = "a"
x = "b"
<!VAL_REASSIGNMENT!>this.x<!> = "c"
x = "d" // don't repeat the same diagnostic again with this receiver
this.x = "e"
<!VAL_REASSIGNMENT!>next?.x<!> = "f"
}
}