[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:
pyos
2020-11-25 11:49:35 +01:00
committed by Mikhail Glukhikh
parent 4d7b6c022b
commit 6cb573cb45
7 changed files with 78 additions and 36 deletions
@@ -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