Perform bytecode optimisations for inline classes
#KT-23742 Fixed
This commit is contained in:
+15
-1
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
// https://youtrack.jetbrains.com/issue/KT-15871
|
||||
|
||||
// FILE: Test.kt
|
||||
@@ -10,8 +12,20 @@ fun getAndCheckInt(a: Int, b: Int) =
|
||||
// 0 Value
|
||||
// 0 areEqual
|
||||
|
||||
// FILE: TestInlined.kt
|
||||
|
||||
fun getAndCheckInlinedInt(a: InlinedInt, b: InlinedInt) =
|
||||
getAndCheck({ a }, { b })
|
||||
|
||||
// @TestInlinedKt.class:
|
||||
// 0 valueOf
|
||||
// 0 Value
|
||||
// 0 areEqual
|
||||
// 0 INVOKESTATIC InlinedInt\$Erased.box
|
||||
// 0 INVOKEVIRTUAL InlinedInt.unbox
|
||||
|
||||
// FILE: Inline.kt
|
||||
inline fun <T> getAndCheck(getFirst: () -> T, getSecond: () -> T) =
|
||||
getFirst() == getSecond()
|
||||
|
||||
|
||||
inline class InlinedInt(val x: Int)
|
||||
|
||||
Reference in New Issue
Block a user