c46164481a
Allow kotlin.jvm.internal.Intrinsics#areEqual for boxed values. Rewrite to primitive equality. NB we can't do that for Float and Double, because java.lang.Float#equals and java.lang.Double#equals behave differently from primitive equality comparisons.
19 lines
343 B
Kotlin
Vendored
19 lines
343 B
Kotlin
Vendored
// IGNORE_BACKEND: JS
|
|
fun box(): String {
|
|
val plusZero: Double? = 0.0
|
|
val minusZero: Double = -0.0
|
|
|
|
useBoxed(plusZero)
|
|
|
|
if (plusZero?.equals(minusZero) ?: null!!) {
|
|
return "fail 1"
|
|
}
|
|
|
|
if (plusZero?.compareTo(minusZero) ?: null!! != 1) {
|
|
return "fail 2"
|
|
}
|
|
|
|
return "OK"
|
|
}
|
|
|
|
fun useBoxed(a: Any?) {} |