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
19 lines
367 B
Kotlin
Vendored
19 lines
367 B
Kotlin
Vendored
// !LANGUAGE: -ReadDeserializedContracts -UseCallsInPlaceEffect
|
|
// See KT-17479
|
|
|
|
class Test {
|
|
val str: String
|
|
init {
|
|
run {
|
|
this@Test.str = "A"
|
|
}
|
|
|
|
run {
|
|
// Not sure do we need diagnostic also here
|
|
this@Test.<!VAL_REASSIGNMENT!>str<!> = "B"
|
|
}
|
|
|
|
<!VAL_REASSIGNMENT!>str<!> = "C"
|
|
}
|
|
}
|