mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
Fix for KT-9692: Deadlock between <clinit> of a class (KtSimpleNameExpressionImpl) and <clinit> of its companion object #KT-9692 Fixed
22 lines
433 B
Kotlin
Vendored
22 lines
433 B
Kotlin
Vendored
open class Static(): IStatic {
|
|
val p = IStatic::class.java.getDeclaredField("const").get(null)
|
|
}
|
|
|
|
interface IStatic {
|
|
fun doSth() {
|
|
}
|
|
|
|
companion object : Static() {
|
|
const val const = 1;
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
IStatic.doSth()
|
|
|
|
val companion: Any? = CompanionInitialization.getCompanion()
|
|
if (companion == null) return "fail 1"
|
|
if (companion != IStatic) return "fail 2"
|
|
|
|
return "OK"
|
|
} |