mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 08:31:29 +00:00
15 lines
256 B
Kotlin
Vendored
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
|
|
} |