mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
33 lines
663 B
Kotlin
Vendored
33 lines
663 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
// IGNORE_BACKEND: JVM_IR
|
|
|
|
// 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: TestInlined.kt
|
|
|
|
fun getAndCheckInlinedInt(a: InlinedInt, b: InlinedInt) =
|
|
getAndCheck({ a }, { b })
|
|
|
|
// @TestInlinedKt.class:
|
|
// 0 valueOf
|
|
// 0 Value
|
|
// 1 areEqual
|
|
// 2 INVOKESTATIC InlinedInt\.box
|
|
// 0 INVOKEVIRTUAL InlinedInt.unbox
|
|
|
|
// FILE: Inline.kt
|
|
inline fun <T> getAndCheck(getFirst: () -> T, getSecond: () -> T) =
|
|
getFirst() == getSecond()
|
|
|
|
inline class InlinedInt(val x: Int)
|