Files
kotlin/compiler/testData/diagnostics/tests/constructorConsistency/lateInit.kt
2016-06-03 09:45:37 +03:00

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
}