mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
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.
18 lines
320 B
Kotlin
Vendored
18 lines
320 B
Kotlin
Vendored
// https://youtrack.jetbrains.com/issue/KT-15871
|
|
|
|
// FILE: Test.kt
|
|
|
|
fun getAndCheckInt(a: Int, b: Int) =
|
|
getAndCheck({ a }, { b })
|
|
|
|
// @TestKt.class:
|
|
// 0 valueOf
|
|
// 0 Value
|
|
// 0 areEqual
|
|
|
|
// FILE: Inline.kt
|
|
inline fun <T> getAndCheck(getFirst: () -> T, getSecond: () -> T) =
|
|
getFirst() == getSecond()
|
|
|
|
|