JVM IR: Avoid direct lambda invokes in inline tests
This commit is contained in:
committed by
Alexander Udalov
parent
f0760e0550
commit
2acfb3a41f
@@ -4,8 +4,8 @@
|
||||
package test
|
||||
abstract class Introspector {
|
||||
abstract inner class SchemaRetriever(val transaction: String) {
|
||||
inline fun inSchema(crossinline modifier: (String) -> Unit) =
|
||||
{ modifier.invoke(transaction) }()
|
||||
inline fun inSchema(crossinline modifier: (String) -> Unit)
|
||||
{ val lambda = { modifier.invoke(transaction) }; lambda() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Kotlin
|
||||
*S Kotlin
|
||||
*F
|
||||
+ 1 1.kt
|
||||
test/Introspector$SchemaRetriever$inSchema$1
|
||||
test/Introspector$SchemaRetriever$inSchema$lambda$1
|
||||
*L
|
||||
1#1,12:1
|
||||
*E
|
||||
@@ -37,7 +37,7 @@ Kotlin
|
||||
*S Kotlin
|
||||
*F
|
||||
+ 1 1.kt
|
||||
test/Introspector$SchemaRetriever$inSchema$1
|
||||
test/Introspector$SchemaRetriever$inSchema$lambda$1
|
||||
+ 2 2.kt
|
||||
IntrospectorImpl$SchemaRetriever
|
||||
*L
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
package builders
|
||||
|
||||
inline fun call(crossinline init: () -> Unit) {
|
||||
return {
|
||||
val lambda = {
|
||||
init()
|
||||
}()
|
||||
}; lambda()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
@@ -5,7 +5,7 @@ Kotlin
|
||||
*S Kotlin
|
||||
*F
|
||||
+ 1 1.kt
|
||||
builders/_1Kt$call$1
|
||||
builders/_1Kt$call$lambda$1
|
||||
*L
|
||||
1#1,13:1
|
||||
*E
|
||||
@@ -22,13 +22,13 @@ _2Kt
|
||||
builders/_1Kt
|
||||
*L
|
||||
1#1,31:1
|
||||
8#2:32
|
||||
8#2,4:32
|
||||
*S KotlinDebug
|
||||
*F
|
||||
+ 1 2.kt
|
||||
_2Kt
|
||||
*L
|
||||
20#1:32
|
||||
20#1:32,4
|
||||
*E
|
||||
|
||||
SMAP
|
||||
@@ -37,7 +37,7 @@ Kotlin
|
||||
*S Kotlin
|
||||
*F
|
||||
+ 1 1.kt
|
||||
builders/_1Kt$call$1
|
||||
builders/_1Kt$call$lambda$1
|
||||
+ 2 2.kt
|
||||
_2Kt
|
||||
*L
|
||||
|
||||
@@ -17,9 +17,9 @@ fun test(): String {
|
||||
var res = "Fail"
|
||||
|
||||
call {
|
||||
{
|
||||
val lambda ={
|
||||
res = "OK"
|
||||
}()
|
||||
}; lambda()
|
||||
}
|
||||
|
||||
return res
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
package test
|
||||
|
||||
|
||||
inline fun annotatedWith2(crossinline predicate: () -> Boolean) =
|
||||
{ any { predicate() } }()
|
||||
inline fun annotatedWith2(crossinline predicate: () -> Boolean)
|
||||
{ val lambda = { any { predicate() } }; lambda() }
|
||||
|
||||
|
||||
inline fun annotatedWith(crossinline predicate: () -> Boolean) =
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ Kotlin
|
||||
*S Kotlin
|
||||
*F
|
||||
+ 1 1.kt
|
||||
test/_1Kt$annotatedWith2$1
|
||||
test/_1Kt$annotatedWith2$lambda$1
|
||||
+ 2 1.kt
|
||||
test/_1Kt
|
||||
+ 3 2.kt
|
||||
@@ -41,7 +41,7 @@ _2Kt
|
||||
*S KotlinDebug
|
||||
*F
|
||||
+ 1 1.kt
|
||||
test/_1Kt$annotatedWith2$1
|
||||
test/_1Kt$annotatedWith2$lambda$1
|
||||
*L
|
||||
7#1:20
|
||||
7#1:23
|
||||
|
||||
Reference in New Issue
Block a user