99e51f6940
I.e. emit VAL_REASSIGNMENT on repeated assignments to `this.something`, UNINITIALIZED_VARIABLE on reads of it before any assignment if there is no initializer, and CAPTURED_MEMBER_VAL_INITIALIZATION on assignments inside non-called-in-place functions and named classes. ^KT-55528 Fixed
22 lines
919 B
Kotlin
Vendored
22 lines
919 B
Kotlin
Vendored
class Outer {
|
|
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val outerProp: String<!>
|
|
inner class Inner(inner: Inner, outer: Outer) {
|
|
val innerProp: String
|
|
init {
|
|
outerProp // use of outerProp is ok because we're suppose that Outer instance should be initialized
|
|
this@Outer.outerProp
|
|
|
|
this@Outer.<!VAL_REASSIGNMENT!>outerProp<!> = "1"
|
|
<!VAL_REASSIGNMENT!>outerProp<!> = "2" // do not repeat the same diagnostic with this receiver of outer class
|
|
outer.<!VAL_REASSIGNMENT!>outerProp<!> = "3"
|
|
|
|
innerProp = "4" + inner.innerProp
|
|
this@Inner.<!VAL_REASSIGNMENT!>innerProp<!> = "5"
|
|
<!VAL_REASSIGNMENT!>innerProp<!> = "6" // do not repeat the same diagnostic with this receiver
|
|
this@Inner.<!VAL_REASSIGNMENT!>innerProp<!> = "7"
|
|
|
|
inner.<!VAL_REASSIGNMENT!>innerProp<!> = "8"
|
|
}
|
|
}
|
|
}
|