mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Fix bytecode tests after new optimizations
- Turn some const conditions into non-const conditions - Make sure inlined const values are used where required (otherwise they are eliminated by POP backward propagation)
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
fun test1() {
|
||||
val n = null
|
||||
n.elvis { "X1" }
|
||||
"X2".elvis { "X3" }
|
||||
val u1 = n.elvis { "X1" }
|
||||
val u2 = "X2".elvis { "X3" }
|
||||
}
|
||||
|
||||
// @TestKt.class:
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun test1() {
|
||||
fun test1(): String {
|
||||
val u = Unit
|
||||
u.mapNullable({ "X1" }, { "X2" })
|
||||
return u.mapNullable({ "X1" }, { "X2" })
|
||||
}
|
||||
|
||||
// @TestKt.class:
|
||||
@@ -14,5 +14,5 @@ fun test1() {
|
||||
// 0 X2
|
||||
|
||||
// FILE: inline.kt
|
||||
inline fun <T : Any, R> T?.mapNullable(ifNotNull: (T) -> R, ifNull: () -> R) =
|
||||
inline fun <T : Any, R> T?.mapNullable(ifNotNull: (T) -> R, ifNull: () -> R): R =
|
||||
if (this == null) ifNull() else ifNotNull(this)
|
||||
Reference in New Issue
Block a user