mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 15:53:55 +00:00
30 lines
557 B
Kotlin
Vendored
30 lines
557 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
// KT-4351 Cannot resolve reference to self in init of class local to function
|
|
|
|
fun f() {
|
|
class MyClass() {
|
|
init {
|
|
val x: MyClass = MyClass()
|
|
}
|
|
|
|
fun member() {
|
|
val x: MyClass = MyClass()
|
|
}
|
|
}
|
|
|
|
<!LOCAL_OBJECT_NOT_ALLOWED!>object MyObject<!> {
|
|
init {
|
|
val obj: MyObject = MyObject
|
|
}
|
|
}
|
|
|
|
val x: MyClass = MyClass()
|
|
}
|
|
|
|
val closure = {
|
|
class MyClass {
|
|
init {
|
|
val x: MyClass = MyClass()
|
|
}
|
|
}
|
|
} |