7d963e8e07
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
11 lines
259 B
Kotlin
Vendored
11 lines
259 B
Kotlin
Vendored
class A(val next: A? = null) {
|
|
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val x: String<!>
|
|
init {
|
|
<!VAL_REASSIGNMENT!>next?.x<!> = "a"
|
|
}
|
|
}
|
|
|
|
class B(val next: B? = null) {
|
|
var x: String = next?.x ?: "default" // it's ok to use `x` of next
|
|
}
|