mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
26 lines
454 B
Kotlin
Vendored
26 lines
454 B
Kotlin
Vendored
// !LANGUAGE: +InlineClasses
|
|
// IGNORE_BACKEND: JVM_IR
|
|
|
|
// FILE: utils.kt
|
|
|
|
inline class AsInt(val value: Int)
|
|
inline class AsAny(val value: Any)
|
|
|
|
// FILE: test.kt
|
|
|
|
fun takeAny(a: Any) {}
|
|
|
|
fun test() {
|
|
takeAny(AsInt(123)) // box
|
|
takeAny(AsAny(123)) // box int, box inline class
|
|
}
|
|
|
|
// @TestKt.class:
|
|
// 1 INVOKESTATIC AsInt\.box
|
|
// 0 INVOKEVIRTUAL AsInt.unbox
|
|
|
|
// 1 INVOKESTATIC AsAny\.box
|
|
// 0 INVOKEVIRTUAL AsAny.unbox
|
|
|
|
// 1 valueOf
|
|
// 0 intValue |