@@ -286,13 +289,15 @@ private fun createKPropertyType(
)
}
privatefuncreateKFunctionType(
privatefunFirSession.createKFunctionType(
function:FirFunction<*>,
receiverType:ConeKotlinType?,
returnTypeRef:FirResolvedTypeRef,
expectedParameterNumberWithReceiver:Int?,
isSuspend:Boolean
isSuspend:Boolean,
expectedReturnType:ConeKotlinType?
):ConeKotlinType{
// The similar adaptations: defaults and coercion-to-unit happen at org.jetbrains.kotlin.resolve.calls.components.CallableReferencesCandidateFactory.getCallableReferenceAdaptation
valparameterTypes=mutableListOf<ConeKotlinType>()
valexpectedParameterNumber=when{
expectedParameterNumberWithReceiver==null->null
...
...
@@ -306,9 +311,15 @@ private fun createKFunctionType(
FUNCTION_REFERENCE 'public final fun fn0 (): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction0<kotlin.Int> origin=null reflectionTarget=<same>
FUN name:test1 visibility:public modality:FINAL <> () returnType:IrErrorType
RETURN type=kotlin.Nothing from='public final fun test0 (): kotlin.Unit declared in <root>'
CALL 'public final fun useUnit0 (fn: kotlin.Function0<kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun fn0 (): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction0<kotlin.Unit> origin=null reflectionTarget=<same>
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 (): IrErrorType declared in <root>'
FUNCTION_REFERENCE 'public final fun fn1 (x: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Int> origin=null reflectionTarget=<same>
RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in <root>'
CALL 'public final fun useUnit1 (fn: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun fn1 (x: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
FUN name:testV0 visibility:public modality:FINAL <> () returnType:IrErrorType
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testV0 (): IrErrorType declared in <root>'