Files
kotlin-fork/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt6788.fir.kt
T

11 lines
236 B
Kotlin
Vendored

class A(val next: A? = null) {
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val x: String<!>
init {
next?.x = "a"
}
}
class B(val next: B? = null) {
var x: String = next?.x ?: "default" // it's ok to use `x` of next
}