[K/N][K2]: K2 behavioral difference with inconsistent inheritance of ObjCName
The problem arises when retrieveDirectOverriddenOf returns a substitution override member. For such members, it is impossible to get the first base member. For a correct result, it is required to find originalForSubstitutionOverride for all substitutionOverrides. #KT-64276 Fixed
This commit is contained in:
committed by
Space Team
parent
5525a6829a
commit
434470a4f5
@@ -0,0 +1,27 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: kotlin.kt
|
||||
@file:OptIn(ExperimentalObjCName::class)
|
||||
|
||||
package kotlin.native
|
||||
import kotlin.experimental.ExperimentalObjCName
|
||||
|
||||
fun interface BaseInterface {
|
||||
@ObjCName("close")
|
||||
fun close()
|
||||
}
|
||||
|
||||
interface MiddleInterface<S> : BaseInterface {
|
||||
override fun close()
|
||||
}
|
||||
|
||||
interface DerivedInterface<S> : MiddleInterface<S> {
|
||||
override fun close()
|
||||
}
|
||||
|
||||
open class BaseClass {
|
||||
@ObjCName("close")
|
||||
fun close() {
|
||||
}
|
||||
}
|
||||
|
||||
class DerivedClass : BaseClass(), DerivedInterface<Any> {}
|
||||
@@ -0,0 +1,23 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: kotlin.kt
|
||||
@file:OptIn(ExperimentalObjCName::class)
|
||||
|
||||
package kotlin.native
|
||||
import kotlin.experimental.ExperimentalObjCName
|
||||
|
||||
fun interface BaseInterface {
|
||||
@ObjCName("close")
|
||||
fun close()
|
||||
}
|
||||
|
||||
interface DerivedInterface<S> : BaseInterface {
|
||||
override fun close()
|
||||
}
|
||||
|
||||
open class BaseClass {
|
||||
@ObjCName("close")
|
||||
fun close(){
|
||||
}
|
||||
}
|
||||
|
||||
class DerivedClass : BaseClass(), DerivedInterface<Any> {}
|
||||
@@ -0,0 +1,31 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: kotlin.kt
|
||||
@file:OptIn(ExperimentalObjCName::class)
|
||||
|
||||
package kotlin.native
|
||||
|
||||
import kotlin.experimental.ExperimentalObjCName
|
||||
|
||||
fun interface BaseInterface {
|
||||
@ObjCName("close")
|
||||
fun close()
|
||||
}
|
||||
|
||||
interface DerivedInterface : BaseInterface {
|
||||
override fun close()
|
||||
}
|
||||
|
||||
fun interface IntersectionInterface {
|
||||
@ObjCName("close")
|
||||
fun close()
|
||||
}
|
||||
|
||||
open class IntersectionAbstract<T> {
|
||||
@ObjCName("close")
|
||||
fun close() {
|
||||
}
|
||||
}
|
||||
|
||||
open class IntersectionBaseClass<T> : IntersectionAbstract<T>(), IntersectionInterface
|
||||
|
||||
class DerivedClass : IntersectionBaseClass<Any>(), DerivedInterface {}
|
||||
@@ -0,0 +1,31 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: kotlin.kt
|
||||
@file:OptIn(ExperimentalObjCName::class)
|
||||
|
||||
package kotlin.native
|
||||
|
||||
import kotlin.experimental.ExperimentalObjCName
|
||||
|
||||
fun interface BaseInterface {
|
||||
@ObjCName("close")
|
||||
fun close()
|
||||
}
|
||||
|
||||
interface DerivedInterface : BaseInterface {
|
||||
override fun close()
|
||||
}
|
||||
|
||||
fun interface IntersectionInterface {
|
||||
@ObjCName("close")
|
||||
fun close()
|
||||
}
|
||||
|
||||
open class IntersectionAbstract {
|
||||
@ObjCName("close")
|
||||
fun close() {
|
||||
}
|
||||
}
|
||||
|
||||
open class IntersectionBaseClass : IntersectionAbstract(), IntersectionInterface
|
||||
|
||||
class DerivedClass : IntersectionBaseClass(), DerivedInterface {}
|
||||
Reference in New Issue
Block a user