K1: Implement a checker that disallows to have different member scopes for expect open and its actual
^KT-22841 Fixed Review: https://jetbrains.team/p/kt/reviews/11603/timeline The commit also introduces `@AllowDifferentMembersInActual` annotation in stdlib which allows to suppress the diagnostic
This commit is contained in:
@@ -32,4 +32,7 @@ public actual interface KClass<T : Any> : KClassifier {
|
||||
@SinceKotlin("1.1")
|
||||
public actual fun isInstance(value: Any?): Boolean
|
||||
|
||||
actual override fun equals(other: Any?): Boolean // KT-24971
|
||||
|
||||
actual override fun hashCode(): Int // KT-24971
|
||||
}
|
||||
@@ -15,6 +15,9 @@ internal object NothingKClassImpl : KClass<Nothing> {
|
||||
override val qualifiedName: String get() = "kotlin.Nothing"
|
||||
|
||||
override fun isInstance(value: Any?): Boolean = false
|
||||
|
||||
override fun equals(other: Any?): Boolean = super.equals(other) // KT-24971
|
||||
override fun hashCode(): Int = super.hashCode() // KT-24971
|
||||
}
|
||||
|
||||
internal object ErrorKClass : KClass<Nothing> {
|
||||
@@ -22,6 +25,9 @@ internal object ErrorKClass : KClass<Nothing> {
|
||||
override val qualifiedName: String get() = error("Unknown qualifiedName for ErrorKClass")
|
||||
|
||||
override fun isInstance(value: Any?): Boolean = error("Can's check isInstance on ErrorKClass")
|
||||
|
||||
override fun equals(other: Any?): Boolean = super.equals(other) // KT-24971
|
||||
override fun hashCode(): Int = super.hashCode() // KT-24971
|
||||
}
|
||||
|
||||
internal class KClassImpl<T : Any>(internal val typeData: TypeInfoData) : KClass<T> {
|
||||
|
||||
Reference in New Issue
Block a user