[Tests] Add test for suspend SAM conversion with trailing lambda

#KT-65878
#KT-66124
This commit is contained in:
Kirill Rakhman
2024-03-01 15:35:02 +01:00
committed by Space Team
parent 5a00984607
commit 1a5fa8d3f6
3 changed files with 15 additions and 0 deletions
@@ -44,6 +44,13 @@ FILE fqName:<root> fileName:/suspendSamConstructorAdaptation.kt
TYPE_OP type=<root>.FunInterface origin=SAM_CONVERSION typeOperand=<root>.FunInterface
FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit declared in <root>.box' type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null
$receiver: GET_VAR 'val lambda: kotlin.Function0<kotlin.Unit> declared in <root>.box' type=kotlin.Function0<kotlin.Unit> origin=null
CALL 'public final fun func (f: <root>.FunInterface): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
f: TYPE_OP type=<root>.FunInterface origin=SAM_CONVERSION typeOperand=<root>.FunInterface
FUN_EXPR type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend]
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.box'
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="OK"
FUN name:func visibility:public modality:FINAL <> (f:<root>.FunInterface) returnType:kotlin.Unit
@@ -44,6 +44,13 @@ FILE fqName:<root> fileName:/suspendSamConstructorAdaptation.kt
TYPE_OP type=<root>.FunInterface origin=SAM_CONVERSION typeOperand=<root>.FunInterface
FUNCTION_REFERENCE 'local final fun suspendConversion1 (): kotlin.Unit declared in <root>.box' type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null
$receiver: GET_VAR 'val lambda: kotlin.Function0<kotlin.Unit> declared in <root>.box' type=kotlin.Function0<kotlin.Unit> origin=null
CALL 'public final fun func (f: <root>.FunInterface): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
f: TYPE_OP type=<root>.FunInterface origin=SAM_CONVERSION typeOperand=<root>.FunInterface
FUN_EXPR type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend]
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.box'
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="OK"
FUN name:func visibility:public modality:FINAL <> (f:<root>.FunInterface) returnType:kotlin.Unit
@@ -12,5 +12,6 @@ fun box(): String {
val lambda: () -> Unit = { }
func(f = lambda)
func(lambda)
func {}
return "OK"
}