Make KClasses for primitives equal to KClasses for wrapper types
Both primitive int and wrapper type java.lang.Integer are represented by the single type kotlin.Int in Kotlin, so inequality between the corresponding KClasses was confusing here. To keep the old behavior, one may call 'k1.java == k2.java' instead of `k1 == k2` #KT-13462 Fixed
This commit is contained in:
@@ -196,10 +196,10 @@ internal class KClassImpl<T : Any>(override val jClass: Class<T>) :
|
||||
get() = descriptor.isCompanionObject
|
||||
|
||||
override fun equals(other: Any?): Boolean =
|
||||
other is KClassImpl<*> && jClass == other.jClass
|
||||
other is KClassImpl<*> && javaObjectType == other.javaObjectType
|
||||
|
||||
override fun hashCode(): Int =
|
||||
jClass.hashCode()
|
||||
javaObjectType.hashCode()
|
||||
|
||||
override fun toString(): String {
|
||||
return "class " + classId.let { classId ->
|
||||
|
||||
Reference in New Issue
Block a user