[JVM IR] Ensure there is one accessor for each super access from a

subclass when there are multiple subclasses in a file.
This commit is contained in:
Mark Punzalan
2020-03-04 23:00:07 -08:00
committed by Alexander Udalov
parent 34fb636904
commit a732e8f5fe
13 changed files with 154 additions and 45 deletions
@@ -0,0 +1,20 @@
// IGNORE_BACKEND_FIR: JVM_IR
open class A {
open fun test(s: String) = s
}
object B : A() {
override fun test(s: String) = "fail"
val doTest = { super.test("O") }
}
object C : A() {
override fun test(s: String) = "fail"
val doTest = { super.test("K") }
}
fun box(): String {
return B.doTest() + C.doTest()
}
@@ -0,0 +1,27 @@
// FILE: 1.kt
package test
open class A {
open fun test(s: String) = s
}
object B : A() {
override fun test(s: String) = "fail"
inline fun doTest(s: String) = super.test(s)
}
object C : A() {
override fun test(s: String) = "fail"
inline fun doTest(s: String) = super.test(s)
}
// FILE: 2.kt
import test.*
fun box(): String {
return B.doTest("O") + C.doTest("K")
}