diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/FunctionsTypingVisitor.kt b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/FunctionsTypingVisitor.kt index 1d1a64d27c4..1d10bffea6d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/FunctionsTypingVisitor.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/FunctionsTypingVisitor.kt @@ -131,9 +131,7 @@ public class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Express val safeReturnType = computeReturnType(expression, context, functionDescriptor, functionTypeExpected) functionDescriptor.setReturnType(safeReturnType) - val receiver = DescriptorUtils.getReceiverParameterType(functionDescriptor.getExtensionReceiverParameter()) - val valueParametersTypes = ExpressionTypingUtils.getValueParametersTypes(functionDescriptor.getValueParameters()) - val resultType = components.builtIns.getFunctionType(Annotations.EMPTY, receiver, valueParametersTypes, safeReturnType) + val resultType = createFunctionType(functionDescriptor)!! if (!noExpectedType(expectedType) && KotlinBuiltIns.isFunctionOrExtensionFunctionType(expectedType)) { // all checks were done before return JetTypeInfo.create(resultType, context.dataFlowInfo)