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:
@@ -0,0 +1,15 @@
|
||||
// WITH_REFLECT
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertFalse
|
||||
|
||||
fun box(): String {
|
||||
val x = Int::class.javaPrimitiveType!!.kotlin
|
||||
val y = Int::class.javaObjectType.kotlin
|
||||
|
||||
assertEquals(x, y)
|
||||
assertEquals(x.hashCode(), y.hashCode())
|
||||
assertFalse(x === y)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user