FIR2IR: apply suspend conversions also to varargs

This commit is contained in:
Mikhail Glukhikh
2021-12-08 15:51:45 +03:00
committed by TeamCityServer
parent 8c7f659a32
commit e1ca5fe344
4 changed files with 80 additions and 30 deletions
@@ -9,9 +9,23 @@ FILE fqName:<root> fileName:/suspendConversionInVararg.kt
BLOCK_BODY
CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0<kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
sfn: VARARG type=kotlin.Array<out kotlin.coroutines.SuspendFunction0<kotlin.Unit>> varargElementType=kotlin.coroutines.SuspendFunction0<kotlin.Unit>
GET_VAR 'f1: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsSome' type=kotlin.Function0<kotlin.Unit> origin=null
BLOCK type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION
FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit [suspend]
$receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null
$this: GET_VAR 'callee: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsSome.suspendConversion' type=kotlin.Function0<kotlin.Unit> origin=null
FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit [suspend] declared in <root>.testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null
$receiver: GET_VAR 'f1: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsSome' type=kotlin.Function0<kotlin.Unit> origin=null
GET_VAR 'sf2: kotlin.coroutines.SuspendFunction0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=null
GET_VAR 'f3: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsSome' type=kotlin.Function0<kotlin.Unit> origin=null
BLOCK type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION
FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit [suspend]
$receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null
$this: GET_VAR 'callee: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsSome.suspendConversion' type=kotlin.Function0<kotlin.Unit> origin=null
FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit [suspend] declared in <root>.testSuspendConversionInVarargElementsSome' type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null
$receiver: GET_VAR 'f3: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsSome' type=kotlin.Function0<kotlin.Unit> origin=null
FUN name:testSuspendConversionInVarargElementsAll visibility:public modality:FINAL <> (f1:kotlin.Function0<kotlin.Unit>, f2:kotlin.Function0<kotlin.Unit>, f3:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit
VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0<kotlin.Unit>
VALUE_PARAMETER name:f2 index:1 type:kotlin.Function0<kotlin.Unit>
@@ -19,6 +33,27 @@ FILE fqName:<root> fileName:/suspendConversionInVararg.kt
BLOCK_BODY
CALL 'public final fun useSuspendVararg (vararg sfn: kotlin.coroutines.SuspendFunction0<kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
sfn: VARARG type=kotlin.Array<out kotlin.coroutines.SuspendFunction0<kotlin.Unit>> varargElementType=kotlin.coroutines.SuspendFunction0<kotlin.Unit>
GET_VAR 'f1: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsAll' type=kotlin.Function0<kotlin.Unit> origin=null
GET_VAR 'f2: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsAll' type=kotlin.Function0<kotlin.Unit> origin=null
GET_VAR 'f3: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsAll' type=kotlin.Function0<kotlin.Unit> origin=null
BLOCK type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION
FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit [suspend]
$receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null
$this: GET_VAR 'callee: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsAll.suspendConversion' type=kotlin.Function0<kotlin.Unit> origin=null
FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit [suspend] declared in <root>.testSuspendConversionInVarargElementsAll' type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null
$receiver: GET_VAR 'f1: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsAll' type=kotlin.Function0<kotlin.Unit> origin=null
BLOCK type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION
FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit [suspend]
$receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null
$this: GET_VAR 'callee: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsAll.suspendConversion' type=kotlin.Function0<kotlin.Unit> origin=null
FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit [suspend] declared in <root>.testSuspendConversionInVarargElementsAll' type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null
$receiver: GET_VAR 'f2: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsAll' type=kotlin.Function0<kotlin.Unit> origin=null
BLOCK type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION
FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Unit [suspend]
$receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=null
$this: GET_VAR 'callee: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsAll.suspendConversion' type=kotlin.Function0<kotlin.Unit> origin=null
FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit [suspend] declared in <root>.testSuspendConversionInVarargElementsAll' type=kotlin.coroutines.SuspendFunction0<kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null
$receiver: GET_VAR 'f3: kotlin.Function0<kotlin.Unit> declared in <root>.testSuspendConversionInVarargElementsAll' type=kotlin.Function0<kotlin.Unit> origin=null