[PSI, FE] Support functional types
This commit is contained in:
committed by
TeamCityServer
parent
e53cee77a3
commit
e3f987459c
@@ -100,6 +100,7 @@ class JvmRuntimeTypes(
|
||||
descriptor.builtIns,
|
||||
Annotations.EMPTY,
|
||||
actualFunctionDescriptor.extensionReceiverParameter?.type,
|
||||
actualFunctionDescriptor.contextReceiverParameters.map { it.type },
|
||||
actualFunctionDescriptor.valueParameters.map { it.type },
|
||||
null,
|
||||
actualFunctionDescriptor.returnType!!
|
||||
@@ -146,6 +147,7 @@ class JvmRuntimeTypes(
|
||||
Annotations.EMPTY,
|
||||
if (isBound) null else referencedFunction.extensionReceiverParameter?.type
|
||||
?: referencedFunction.dispatchReceiverParameter?.type,
|
||||
referencedFunction.contextReceiverParameters.map { it.type },
|
||||
anonymousFunctionDescriptor.valueParameters.drop(receivers).map { it.type },
|
||||
null,
|
||||
anonymousFunctionDescriptor.returnType!!,
|
||||
|
||||
@@ -94,7 +94,8 @@ fun InstructionAdapter.generateClosureFieldsInitializationFromParameters(
|
||||
}
|
||||
|
||||
fun computeExpectedNumberOfReceivers(referencedFunction: FunctionDescriptor, isBound: Boolean): Int {
|
||||
val receivers = (if (referencedFunction.dispatchReceiverParameter != null) 1 else 0) +
|
||||
val receivers = referencedFunction.contextReceiverParameters.size +
|
||||
(if (referencedFunction.dispatchReceiverParameter != null) 1 else 0) +
|
||||
(if (referencedFunction.extensionReceiverParameter != null) 1 else 0) -
|
||||
(if (isBound) 1 else 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user