JVM IR: Mangle overridden symbols in non-inline functions (KT-52394)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// WITH_REFLECT
|
||||
// TARGET_BACKEND: JVM
|
||||
import kotlin.reflect.full.declaredFunctions
|
||||
|
||||
annotation class Anno(val value: String)
|
||||
|
||||
@JvmInline
|
||||
value class A(val value: String)
|
||||
|
||||
abstract class B {
|
||||
@Anno(value = "K")
|
||||
abstract fun f(): A?
|
||||
}
|
||||
|
||||
class C : B() {
|
||||
override fun f(): A? = A("O")
|
||||
}
|
||||
|
||||
class D : B() {
|
||||
override fun f(): Nothing? = null
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val o = if ((D() as B).f() == null) (C() as B).f()!!.value else "Fail"
|
||||
|
||||
val annotations = B::class.declaredFunctions.single().annotations
|
||||
val k = (annotations.single() as Anno).value
|
||||
|
||||
return o + k
|
||||
}
|
||||
Reference in New Issue
Block a user