[FIR] Import parents of companion objects first
Otherwise, information about members moved from companion objects to the parent class (e.g. on JVM, companion object fields -> static fields in parent class) will be incorrect.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// WITH_RUNTIME
|
||||
// TARGET_BACKEND: JVM
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
class C(val x: String) {
|
||||
companion object {
|
||||
@JvmField
|
||||
val instance: C = C("OK")
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
import test.C.Companion.instance
|
||||
|
||||
fun box() = instance.x
|
||||
Reference in New Issue
Block a user