[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:
committed by
Alexander Udalov
parent
34fb636904
commit
a732e8f5fe
+20
@@ -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()
|
||||
}
|
||||
+27
@@ -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")
|
||||
}
|
||||
Reference in New Issue
Block a user