mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
22 lines
291 B
Kotlin
Vendored
22 lines
291 B
Kotlin
Vendored
fun foo() {
|
|
var x: String
|
|
class A {
|
|
init {
|
|
x = ""
|
|
}
|
|
}
|
|
// Error! See KT-10042
|
|
<!UNINITIALIZED_VARIABLE!>x<!>.length
|
|
}
|
|
|
|
fun bar() {
|
|
var x: String
|
|
object: Any() {
|
|
init {
|
|
x = ""
|
|
}
|
|
}
|
|
// Ok
|
|
x.length
|
|
}
|