[FIR2IR] Fix cast insertion in SAM conversion with suspend conversion

#KT-65878
#KT-62855
This commit is contained in:
Kirill Rakhman
2024-02-19 10:59:34 +01:00
committed by Space Team
parent a2a217799b
commit b054a4481d
7 changed files with 38 additions and 139 deletions
@@ -1,73 +0,0 @@
MODULE main
CLASS Kt50477EnabledKt$box$1.class
Property: class.signature
K1
NULL
K2
Lkotlin/jvm/internal/FunctionReferenceImpl;Lkotlin/jvm/functions/Function1<Lkotlin/coroutines/Continuation<-Lkotlin/Unit;>;Ljava/lang/Object;>;Lkotlin/coroutines/jvm/internal/SuspendFunction;
Property: class.superClassInternalName
K1
java/lang/Object
K2
kotlin/jvm/internal/FunctionReferenceImpl
Property: class.superInterfaces
K1
[FI, kotlin/jvm/internal/FunctionAdapter]
K2
[kotlin/coroutines/jvm/internal/SuspendFunction, kotlin/jvm/functions/Function1]
K1
call(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; [public, final]
K2
---
K1
equals(Ljava/lang/Object;)Z [public, final]
K2
---
K1
getFunctionDelegate()Lkotlin/Function; [public, final]
K2
---
K1
hashCode()I [public, final]
K2
---
K1
---
K2
invoke(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; [public, final]
CLASS Kt50477EnabledKt$box$4.class
Property: class.signature
K1
NULL
K2
Lkotlin/jvm/internal/FunctionReferenceImpl;Lkotlin/jvm/functions/Function1<Lkotlin/coroutines/Continuation<-Lkotlin/Unit;>;Ljava/lang/Object;>;Lkotlin/coroutines/jvm/internal/SuspendFunction;
Property: class.superClassInternalName
K1
java/lang/Object
K2
kotlin/jvm/internal/FunctionReferenceImpl
Property: class.superInterfaces
K1
[FI, kotlin/jvm/internal/FunctionAdapter]
K2
[kotlin/coroutines/jvm/internal/SuspendFunction, kotlin/jvm/functions/Function1]
K1
call(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; [public, final]
K2
---
K1
equals(Ljava/lang/Object;)Z [public, final]
K2
---
K1
getFunctionDelegate()Lkotlin/Function; [public, final]
K2
---
K1
hashCode()I [public, final]
K2
---
K1
---
K2
invoke(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; [public, final]
-1
View File
@@ -1,6 +1,5 @@
// !LANGUAGE: +SuspendOnlySamConversions
// TARGET_BACKEND: JVM_IR
// JVM_ABI_K1_K2_DIFF: KT-62855
fun interface FI {
suspend fun call() // suspending now(!!!)
@@ -1,31 +0,0 @@
MODULE main
Missing in K1
ChainedFunSuspendConversionForSimpleExpressionKt$sam$SuspendRunnable$0.class
CLASS ChainedFunSuspendConversionForSimpleExpressionKt$test$2.class
Property: class.signature
K1
NULL
K2
Lkotlin/jvm/internal/FunctionReferenceImpl;Lkotlin/jvm/functions/Function1<Lkotlin/coroutines/Continuation<-Lkotlin/Unit;>;Ljava/lang/Object;>;Lkotlin/coroutines/jvm/internal/SuspendFunction;
Property: class.superClassInternalName
K1
java/lang/Object
K2
kotlin/jvm/internal/FunctionReferenceImpl
Property: class.superInterfaces
K1
[SuspendRunnable, kotlin/jvm/internal/FunctionAdapter]
K2
[kotlin/coroutines/jvm/internal/SuspendFunction, kotlin/jvm/functions/Function1]
K1
equals(Ljava/lang/Object;)Z [public, final]
K2
---
K1
getFunctionDelegate()Lkotlin/Function; [public, final]
K2
---
K1
hashCode()I [public, final]
K2
---
@@ -1,6 +1,5 @@
// !LANGUAGE: +SuspendConversion
// IGNORE_BACKEND: JVM
// JVM_ABI_K1_K2_DIFF: KT-62855
fun interface SuspendRunnable {
suspend fun invoke()
@@ -2,6 +2,5 @@ MODULE main
Missing in K1
Test1$Scope$bar$1.class
Test2$Scope$bar$1.class
SuspendAndFunConversionInDisabledModeKt$sam$SuspendRunnable$0.class
Missing in K2
SuspendAndFunConversionInDisabledModeKt$sam$Runnable$0.class