[FE] Use DescriptorFactory.createContextReceiverParameterForCallable

This commit is contained in:
Anastasiya Shadrina
2021-11-22 18:57:48 +07:00
committed by TeamCityServer
parent 13c8531f3a
commit 2954c5cc9c
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.descriptors.annotations.Annotations;
import org.jetbrains.kotlin.descriptors.annotations.AnnotationsKt; import org.jetbrains.kotlin.descriptors.annotations.AnnotationsKt;
import org.jetbrains.kotlin.name.Name; import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.resolve.DescriptorFactory;
import org.jetbrains.kotlin.resolve.scopes.receivers.ExtensionReceiver; import org.jetbrains.kotlin.resolve.scopes.receivers.ExtensionReceiver;
import org.jetbrains.kotlin.types.*; import org.jetbrains.kotlin.types.*;
import org.jetbrains.kotlin.utils.SmartList; import org.jetbrains.kotlin.utils.SmartList;
@@ -632,13 +633,9 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
if (substitutedContextReceiverType == null) { if (substitutedContextReceiverType == null) {
return null; return null;
} }
ReceiverParameterDescriptor substitutedContextReceiverParameter = new ReceiverParameterDescriptorImpl( ReceiverParameterDescriptor substitutedContextReceiverParameter =
substitutedDescriptor, DescriptorFactory.createContextReceiverParameterForCallable(substitutedDescriptor, substitutedContextReceiverType,
new ExtensionReceiver( newContextReceiverParameter.getAnnotations());
substitutedDescriptor, substitutedContextReceiverType, newContextReceiverParameter.getValue()
),
newContextReceiverParameter.getAnnotations()
);
substitutedContextReceiverParameters.add(substitutedContextReceiverParameter); substitutedContextReceiverParameters.add(substitutedContextReceiverParameter);
wereChanges[0] |= substitutedContextReceiverType != newContextReceiverParameter.getType(); wereChanges[0] |= substitutedContextReceiverType != newContextReceiverParameter.getType();