Files
kotlin-fork/compiler/testData/diagnostics/tests/constructorConsistency/lateInit.fir.kt
T

15 lines
256 B
Kotlin
Vendored

class WithLateInit {
lateinit var x: String
fun init(xx: String) {
x = xx
}
init {
// This is obviously a bug,
// but with lateinit we explicitly want it to occur in runtime
use()
}
fun use() = x
}