Files
kotlin-fork/compiler/testData/codegen/box/boxingOptimization/explicitEqualsOnDouble.kt
T
Dmitry Petrov c46164481a KT-15871 Unnecessary boxing for equality operator on inlined primitive values
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.
2017-03-13 09:04:31 +03:00

9 lines
154 B
Kotlin
Vendored

// IGNORE_BACKEND: JS
fun equals1(a: Double, b: Double) = a.equals(b)
fun box(): String {
if ((-0.0).equals(0.0)) return "fail 0"
return "OK"
}