Always do stack spilling during inline cause of dex problem
Dex issue: https://issuetracker.google.com/issues/68796377 #KT-20844 Fixed
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
//WITH_RUNTIME
|
||||
|
||||
fun foo(x: String, ys: List<String>) =
|
||||
x + ys.fold("", { a, b -> a + b })
|
||||
|
||||
var flag = true
|
||||
|
||||
fun box(): String =
|
||||
foo("O", if (flag) listOf("k").map { it.toUpperCase() } else listOf())
|
||||
@@ -0,0 +1,27 @@
|
||||
// FILE: 1.kt
|
||||
//WITH_RUNTIME
|
||||
package test
|
||||
|
||||
data class Address(
|
||||
val createdTimeMs: Long = 0,
|
||||
val firstName: String = "",
|
||||
val lastName: String = ""
|
||||
)
|
||||
|
||||
inline fun String.switchIfEmpty(provider: () -> String): String {
|
||||
return if (isEmpty()) provider() else this
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val address = Address()
|
||||
val result = address.copy(
|
||||
firstName = address.firstName.switchIfEmpty { "O" },
|
||||
lastName = address.lastName.switchIfEmpty { "K" }
|
||||
)
|
||||
|
||||
return result.firstName + result.lastName
|
||||
}
|
||||
@@ -9,6 +9,6 @@ fun foo() : Int {
|
||||
return foobar(1, bar(2), 3)
|
||||
}
|
||||
|
||||
// 1 ISTORE
|
||||
// 5 ILOAD
|
||||
// 3 ISTORE
|
||||
// 7 ILOAD
|
||||
// 0 InlineMarker
|
||||
|
||||
Reference in New Issue
Block a user