JVM IR: Avoid direct lambda invokes in inline tests
This commit is contained in:
committed by
Alexander Udalov
parent
f0760e0550
commit
2acfb3a41f
+1
-1
@@ -4,7 +4,7 @@
|
||||
package test
|
||||
|
||||
inline fun call(crossinline s: () -> String): String {
|
||||
return { s() } ()
|
||||
return { s() }.let { it() }
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@ package test
|
||||
inline fun call(crossinline s: () -> String): String {
|
||||
return {
|
||||
s()
|
||||
}()
|
||||
}.let { it() }
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
package test
|
||||
|
||||
// Argument `f` of `call$default` is technically nullable and inline.
|
||||
inline fun call(other: Int = 1, crossinline f: () -> String = { "fail" }) = { f() }()
|
||||
inline fun call(other: Int = 1, crossinline f: () -> String = { "fail" }) = { f() }.let { it() }
|
||||
|
||||
// FILE: 2.kt
|
||||
import test.*
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@ package test
|
||||
inline fun call(crossinline s: () -> String): String {
|
||||
return {
|
||||
s()
|
||||
}()
|
||||
}.let { it() }
|
||||
}
|
||||
|
||||
open class Base {
|
||||
|
||||
Reference in New Issue
Block a user