Take ReceiverParameterDescriptor in FunctionDescriptorImpl.initialize

Instead of just KotlinType. This will allow to pass annotations on the
receiver at call sites
This commit is contained in:
Alexander Udalov
2018-08-08 16:35:21 +02:00
parent 6fb39785ff
commit 34c033bcaf
39 changed files with 200 additions and 107 deletions
@@ -31,8 +31,8 @@ import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
import org.jetbrains.kotlin.diagnostics.Diagnostic
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
import org.jetbrains.kotlin.idea.core.ShortenReferences
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.load.java.NOT_NULL_ANNOTATIONS
@@ -219,7 +219,7 @@ class ChangeMemberFunctionSignatureFix private constructor(
return descriptor.apply {
initialize(
function.extensionReceiverParameter?.type, function.dispatchReceiverParameter,
function.extensionReceiverParameter?.copy(this), function.dispatchReceiverParameter,
function.typeParameters, parameters, function.returnType, function.modality, function.visibility
)
isOperator = function.isOperator
@@ -59,7 +59,7 @@ internal class ChangeMethodParameters(
SourceElement.NO_SOURCE
).apply {
initialize(
functionDescriptor.extensionReceiverParameter?.type,
functionDescriptor.extensionReceiverParameter?.copy(this),
functionDescriptor.dispatchReceiverParameter,
functionDescriptor.typeParameters,
request.withIndex().map { (index, parameter) ->