Introduce and implement SimpleFunctionDescriptor.createRenamedCopy
This commit is contained in:
+3
-1
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor;
|
|||||||
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor;
|
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor;
|
||||||
import org.jetbrains.kotlin.load.java.descriptors.JavaMethodDescriptor;
|
import org.jetbrains.kotlin.load.java.descriptors.JavaMethodDescriptor;
|
||||||
import org.jetbrains.kotlin.load.java.descriptors.SamAdapterDescriptor;
|
import org.jetbrains.kotlin.load.java.descriptors.SamAdapterDescriptor;
|
||||||
|
import org.jetbrains.kotlin.name.Name;
|
||||||
|
|
||||||
/* package */ class SamAdapterFunctionDescriptor extends JavaMethodDescriptor implements SamAdapterDescriptor<JavaMethodDescriptor> {
|
/* package */ class SamAdapterFunctionDescriptor extends JavaMethodDescriptor implements SamAdapterDescriptor<JavaMethodDescriptor> {
|
||||||
private final JavaMethodDescriptor declaration;
|
private final JavaMethodDescriptor declaration;
|
||||||
@@ -53,7 +54,8 @@ import org.jetbrains.kotlin.load.java.descriptors.SamAdapterDescriptor;
|
|||||||
protected JavaMethodDescriptor createSubstitutedCopy(
|
protected JavaMethodDescriptor createSubstitutedCopy(
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@Nullable FunctionDescriptor original,
|
@Nullable FunctionDescriptor original,
|
||||||
@NotNull Kind kind
|
@NotNull Kind kind,
|
||||||
|
@Nullable Name newName
|
||||||
) {
|
) {
|
||||||
return new SamAdapterFunctionDescriptor(newOwner, (SimpleFunctionDescriptor) original, kind, declaration);
|
return new SamAdapterFunctionDescriptor(newOwner, (SimpleFunctionDescriptor) original, kind, declaration);
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-6
@@ -141,8 +141,15 @@ class SamAdapterFunctionsScope(storageManager: StorageManager) : BaseImportingSc
|
|||||||
override fun hasStableParameterNames() = sourceFunction.hasStableParameterNames()
|
override fun hasStableParameterNames() = sourceFunction.hasStableParameterNames()
|
||||||
override fun hasSynthesizedParameterNames() = sourceFunction.hasSynthesizedParameterNames()
|
override fun hasSynthesizedParameterNames() = sourceFunction.hasSynthesizedParameterNames()
|
||||||
|
|
||||||
override fun createSubstitutedCopy(newOwner: DeclarationDescriptor, original: FunctionDescriptor?, kind: CallableMemberDescriptor.Kind): MyFunctionDescriptor {
|
override fun createSubstitutedCopy(
|
||||||
return MyFunctionDescriptor(containingDeclaration, original as SimpleFunctionDescriptor?, annotations, name, kind, source).apply {
|
newOwner: DeclarationDescriptor,
|
||||||
|
original: FunctionDescriptor?,
|
||||||
|
kind: CallableMemberDescriptor.Kind,
|
||||||
|
newName: Name?
|
||||||
|
): MyFunctionDescriptor {
|
||||||
|
return MyFunctionDescriptor(
|
||||||
|
containingDeclaration, original as SimpleFunctionDescriptor?, annotations, newName ?: name, kind, source
|
||||||
|
).apply {
|
||||||
sourceFunction = this@MyFunctionDescriptor.sourceFunction
|
sourceFunction = this@MyFunctionDescriptor.sourceFunction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,13 +169,14 @@ class SamAdapterFunctionsScope(storageManager: StorageManager) : BaseImportingSc
|
|||||||
kind: CallableMemberDescriptor.Kind,
|
kind: CallableMemberDescriptor.Kind,
|
||||||
newValueParameterDescriptors: MutableList<ValueParameterDescriptor>,
|
newValueParameterDescriptors: MutableList<ValueParameterDescriptor>,
|
||||||
newExtensionReceiverParameterType: KotlinType?,
|
newExtensionReceiverParameterType: KotlinType?,
|
||||||
newReturnType: KotlinType
|
newReturnType: KotlinType,
|
||||||
|
name: Name?
|
||||||
): FunctionDescriptor? {
|
): FunctionDescriptor? {
|
||||||
val descriptor = super<SimpleFunctionDescriptorImpl>.doSubstitute(
|
val descriptor = super.doSubstitute(
|
||||||
originalSubstitutor, newOwner, newModality, newVisibility,
|
originalSubstitutor, newOwner, newModality, newVisibility,
|
||||||
newIsOperator, newIsInfix, newIsExternal, newIsInline, newIsTailrec, original,
|
newIsOperator, newIsInfix, newIsExternal, newIsInline, newIsTailrec, original,
|
||||||
copyOverrides, kind, newValueParameterDescriptors, newExtensionReceiverParameterType, newReturnType)
|
copyOverrides, kind, newValueParameterDescriptors, newExtensionReceiverParameterType, newReturnType, name)
|
||||||
as MyFunctionDescriptor? ?: return null
|
as MyFunctionDescriptor? ?: return null
|
||||||
|
|
||||||
if (original == null) {
|
if (original == null) {
|
||||||
throw UnsupportedOperationException("doSubstitute with no original should not be called for synthetic extension")
|
throw UnsupportedOperationException("doSubstitute with no original should not be called for synthetic extension")
|
||||||
|
|||||||
+7
-2
@@ -21,6 +21,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import org.jetbrains.kotlin.descriptors.*;
|
import org.jetbrains.kotlin.descriptors.*;
|
||||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
|
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
|
||||||
import org.jetbrains.kotlin.descriptors.impl.ConstructorDescriptorImpl;
|
import org.jetbrains.kotlin.descriptors.impl.ConstructorDescriptorImpl;
|
||||||
|
import org.jetbrains.kotlin.name.Name;
|
||||||
import org.jetbrains.kotlin.types.KotlinType;
|
import org.jetbrains.kotlin.types.KotlinType;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -75,7 +76,8 @@ public class JavaConstructorDescriptor extends ConstructorDescriptorImpl impleme
|
|||||||
protected JavaConstructorDescriptor createSubstitutedCopy(
|
protected JavaConstructorDescriptor createSubstitutedCopy(
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@Nullable FunctionDescriptor original,
|
@Nullable FunctionDescriptor original,
|
||||||
@NotNull Kind kind
|
@NotNull Kind kind,
|
||||||
|
@Nullable Name newName
|
||||||
) {
|
) {
|
||||||
if (kind != Kind.DECLARATION && kind != Kind.SYNTHESIZED) {
|
if (kind != Kind.DECLARATION && kind != Kind.SYNTHESIZED) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
@@ -85,6 +87,9 @@ public class JavaConstructorDescriptor extends ConstructorDescriptorImpl impleme
|
|||||||
"kind: " + kind
|
"kind: " + kind
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert newName == null : "Attempt to rename constructor: " + this;
|
||||||
|
|
||||||
JavaConstructorDescriptor result = new JavaConstructorDescriptor(
|
JavaConstructorDescriptor result = new JavaConstructorDescriptor(
|
||||||
(ClassDescriptor) newOwner, this, getAnnotations(), isPrimary, kind, SourceElement.NO_SOURCE
|
(ClassDescriptor) newOwner, this, getAnnotations(), isPrimary, kind, SourceElement.NO_SOURCE
|
||||||
);
|
);
|
||||||
@@ -100,7 +105,7 @@ public class JavaConstructorDescriptor extends ConstructorDescriptorImpl impleme
|
|||||||
@NotNull List<KotlinType> enhancedValueParametersTypes,
|
@NotNull List<KotlinType> enhancedValueParametersTypes,
|
||||||
@NotNull KotlinType enhancedReturnType
|
@NotNull KotlinType enhancedReturnType
|
||||||
) {
|
) {
|
||||||
JavaConstructorDescriptor enhanced = createSubstitutedCopy(getContainingDeclaration(), getOriginal(), getKind());
|
JavaConstructorDescriptor enhanced = createSubstitutedCopy(getContainingDeclaration(), getOriginal(), getKind(), null);
|
||||||
// We do not use doSubstitute here as in JavaMethodDescriptor.enhance because type parameters of constructor belongs to class
|
// We do not use doSubstitute here as in JavaMethodDescriptor.enhance because type parameters of constructor belongs to class
|
||||||
enhanced.initialize(
|
enhanced.initialize(
|
||||||
enhancedReceiverType,
|
enhancedReceiverType,
|
||||||
|
|||||||
+5
-4
@@ -113,13 +113,14 @@ public class JavaMethodDescriptor extends SimpleFunctionDescriptorImpl implement
|
|||||||
protected JavaMethodDescriptor createSubstitutedCopy(
|
protected JavaMethodDescriptor createSubstitutedCopy(
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@Nullable FunctionDescriptor original,
|
@Nullable FunctionDescriptor original,
|
||||||
@NotNull Kind kind
|
@NotNull Kind kind,
|
||||||
|
@Nullable Name newName
|
||||||
) {
|
) {
|
||||||
JavaMethodDescriptor result = new JavaMethodDescriptor(
|
JavaMethodDescriptor result = new JavaMethodDescriptor(
|
||||||
newOwner,
|
newOwner,
|
||||||
(SimpleFunctionDescriptor) original,
|
(SimpleFunctionDescriptor) original,
|
||||||
getAnnotations(),
|
getAnnotations(),
|
||||||
getName(),
|
newName != null ? newName : getName(),
|
||||||
kind,
|
kind,
|
||||||
original != null ? original.getSource() : SourceElement.NO_SOURCE
|
original != null ? original.getSource() : SourceElement.NO_SOURCE
|
||||||
);
|
);
|
||||||
@@ -144,8 +145,8 @@ public class JavaMethodDescriptor extends SimpleFunctionDescriptorImpl implement
|
|||||||
TypeSubstitutor.EMPTY, getContainingDeclaration(), getModality(), getVisibility(),
|
TypeSubstitutor.EMPTY, getContainingDeclaration(), getModality(), getVisibility(),
|
||||||
isOperator(), isInfix(), isExternal(), isInline(), isTailrec(), getOriginal(),
|
isOperator(), isInfix(), isExternal(), isInline(), isTailrec(), getOriginal(),
|
||||||
/* copyOverrides = */ true, getKind(),
|
/* copyOverrides = */ true, getKind(),
|
||||||
enhancedValueParameters, enhancedReceiverType, enhancedReturnType
|
enhancedValueParameters, enhancedReceiverType, enhancedReturnType,
|
||||||
);
|
null);
|
||||||
|
|
||||||
assert enhancedMethod != null : "null after substitution while enhancing " + toString();
|
assert enhancedMethod != null : "null after substitution while enhancing " + toString();
|
||||||
return enhancedMethod;
|
return enhancedMethod;
|
||||||
|
|||||||
+2
-1
@@ -41,7 +41,8 @@ public class FunctionInvokeDescriptor private constructor(
|
|||||||
override fun createSubstitutedCopy(
|
override fun createSubstitutedCopy(
|
||||||
newOwner: DeclarationDescriptor,
|
newOwner: DeclarationDescriptor,
|
||||||
original: FunctionDescriptor?,
|
original: FunctionDescriptor?,
|
||||||
kind: CallableMemberDescriptor.Kind
|
kind: CallableMemberDescriptor.Kind,
|
||||||
|
newName: Name?
|
||||||
): FunctionInvokeDescriptor {
|
): FunctionInvokeDescriptor {
|
||||||
return FunctionInvokeDescriptor(newOwner, original as FunctionInvokeDescriptor?, kind)
|
return FunctionInvokeDescriptor(newOwner, original as FunctionInvokeDescriptor?, kind)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package org.jetbrains.kotlin.descriptors;
|
package org.jetbrains.kotlin.descriptors;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.name.Name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple functions are the ones with 'fun' keyword and function literals
|
* Simple functions are the ones with 'fun' keyword and function literals
|
||||||
@@ -26,6 +27,9 @@ public interface SimpleFunctionDescriptor extends FunctionDescriptor {
|
|||||||
@Override
|
@Override
|
||||||
SimpleFunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, Visibility visibility, Kind kind, boolean copyOverrides);
|
SimpleFunctionDescriptor copy(DeclarationDescriptor newOwner, Modality modality, Visibility visibility, Kind kind, boolean copyOverrides);
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
SimpleFunctionDescriptor createRenamedCopy(@NotNull Name name);
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
SimpleFunctionDescriptor getOriginal();
|
SimpleFunctionDescriptor getOriginal();
|
||||||
|
|||||||
+3
-1
@@ -114,7 +114,8 @@ public class ConstructorDescriptorImpl extends FunctionDescriptorImpl implements
|
|||||||
protected ConstructorDescriptorImpl createSubstitutedCopy(
|
protected ConstructorDescriptorImpl createSubstitutedCopy(
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@Nullable FunctionDescriptor original,
|
@Nullable FunctionDescriptor original,
|
||||||
@NotNull Kind kind
|
@NotNull Kind kind,
|
||||||
|
@Nullable Name newName
|
||||||
) {
|
) {
|
||||||
if (kind != Kind.DECLARATION && kind != Kind.SYNTHESIZED) {
|
if (kind != Kind.DECLARATION && kind != Kind.SYNTHESIZED) {
|
||||||
throw new IllegalStateException("Attempt at creating a constructor that is not a declaration: \n" +
|
throw new IllegalStateException("Attempt at creating a constructor that is not a declaration: \n" +
|
||||||
@@ -123,6 +124,7 @@ public class ConstructorDescriptorImpl extends FunctionDescriptorImpl implements
|
|||||||
"kind: " + kind);
|
"kind: " + kind);
|
||||||
}
|
}
|
||||||
assert original != null : "Attempt to create copy of constructor without preserving original: " + this;
|
assert original != null : "Attempt to create copy of constructor without preserving original: " + this;
|
||||||
|
assert newName == null : "Attempt to rename constructor: " + this;
|
||||||
return new ConstructorDescriptorImpl(
|
return new ConstructorDescriptorImpl(
|
||||||
(ClassDescriptor) newOwner,
|
(ClassDescriptor) newOwner,
|
||||||
this,
|
this,
|
||||||
|
|||||||
+9
-6
@@ -270,8 +270,8 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
|||||||
) {
|
) {
|
||||||
return doSubstitute(originalSubstitutor,
|
return doSubstitute(originalSubstitutor,
|
||||||
newOwner, newModality, newVisibility, isOperator, isInfix, isExternal, isInline, isTailrec, original, copyOverrides, kind,
|
newOwner, newModality, newVisibility, isOperator, isInfix, isExternal, isInline, isTailrec, original, copyOverrides, kind,
|
||||||
getValueParameters(), getExtensionReceiverParameterType(), getReturnType()
|
getValueParameters(), getExtensionReceiverParameterType(), getReturnType(),
|
||||||
);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -282,7 +282,8 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
|||||||
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected FunctionDescriptor doSubstitute(@NotNull TypeSubstitutor originalSubstitutor,
|
protected FunctionDescriptor doSubstitute(
|
||||||
|
@NotNull TypeSubstitutor originalSubstitutor,
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@NotNull Modality newModality,
|
@NotNull Modality newModality,
|
||||||
@NotNull Visibility newVisibility,
|
@NotNull Visibility newVisibility,
|
||||||
@@ -296,9 +297,10 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
|||||||
@NotNull Kind kind,
|
@NotNull Kind kind,
|
||||||
@NotNull List<ValueParameterDescriptor> newValueParameterDescriptors,
|
@NotNull List<ValueParameterDescriptor> newValueParameterDescriptors,
|
||||||
@Nullable KotlinType newExtensionReceiverParameterType,
|
@Nullable KotlinType newExtensionReceiverParameterType,
|
||||||
@NotNull KotlinType newReturnType
|
@NotNull KotlinType newReturnType,
|
||||||
|
@Nullable Name name
|
||||||
) {
|
) {
|
||||||
FunctionDescriptorImpl substitutedDescriptor = createSubstitutedCopy(newOwner, original, kind);
|
FunctionDescriptorImpl substitutedDescriptor = createSubstitutedCopy(newOwner, original, kind, name);
|
||||||
|
|
||||||
List<TypeParameterDescriptor> originalTypeParameters = getTypeParameters();
|
List<TypeParameterDescriptor> originalTypeParameters = getTypeParameters();
|
||||||
List<TypeParameterDescriptor> substitutedTypeParameters = new ArrayList<TypeParameterDescriptor>(originalTypeParameters.size());
|
List<TypeParameterDescriptor> substitutedTypeParameters = new ArrayList<TypeParameterDescriptor>(originalTypeParameters.size());
|
||||||
@@ -372,7 +374,8 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
|
|||||||
protected abstract FunctionDescriptorImpl createSubstitutedCopy(
|
protected abstract FunctionDescriptorImpl createSubstitutedCopy(
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@Nullable FunctionDescriptor original,
|
@Nullable FunctionDescriptor original,
|
||||||
@NotNull Kind kind
|
@NotNull Kind kind,
|
||||||
|
@Nullable Name newName
|
||||||
);
|
);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
-1
@@ -45,7 +45,8 @@ public class ScriptCodeDescriptor extends FunctionDescriptorImpl {
|
|||||||
protected FunctionDescriptorImpl createSubstitutedCopy(
|
protected FunctionDescriptorImpl createSubstitutedCopy(
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@Nullable FunctionDescriptor original,
|
@Nullable FunctionDescriptor original,
|
||||||
@NotNull Kind kind
|
@NotNull Kind kind,
|
||||||
|
@Nullable Name newName
|
||||||
) {
|
) {
|
||||||
throw new IllegalStateException("no need to copy script code descriptor");
|
throw new IllegalStateException("no need to copy script code descriptor");
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-2
@@ -76,14 +76,15 @@ public class SimpleFunctionDescriptorImpl extends FunctionDescriptorImpl impleme
|
|||||||
protected FunctionDescriptorImpl createSubstitutedCopy(
|
protected FunctionDescriptorImpl createSubstitutedCopy(
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@Nullable FunctionDescriptor original,
|
@Nullable FunctionDescriptor original,
|
||||||
@NotNull Kind kind
|
@NotNull Kind kind,
|
||||||
|
@Nullable Name newName
|
||||||
) {
|
) {
|
||||||
return new SimpleFunctionDescriptorImpl(
|
return new SimpleFunctionDescriptorImpl(
|
||||||
newOwner,
|
newOwner,
|
||||||
(SimpleFunctionDescriptor) original,
|
(SimpleFunctionDescriptor) original,
|
||||||
// TODO : safeSubstitute
|
// TODO : safeSubstitute
|
||||||
getAnnotations(),
|
getAnnotations(),
|
||||||
getName(),
|
newName != null ? newName : getName(),
|
||||||
kind,
|
kind,
|
||||||
SourceElement.NO_SOURCE
|
SourceElement.NO_SOURCE
|
||||||
);
|
);
|
||||||
@@ -104,4 +105,14 @@ public class SimpleFunctionDescriptorImpl extends FunctionDescriptorImpl impleme
|
|||||||
null, copyOverrides, kind
|
null, copyOverrides, kind
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public SimpleFunctionDescriptor createRenamedCopy(@NotNull Name name) {
|
||||||
|
return (SimpleFunctionDescriptorImpl) doSubstitute(
|
||||||
|
TypeSubstitutor.EMPTY, getContainingDeclaration(), getModality(), getVisibility(),
|
||||||
|
isOperator(), isInfix(), isExternal(), isInline(), isTailrec(),
|
||||||
|
null, /* copyOverrides = */ true, getKind(), getValueParameters(), getExtensionReceiverParameterType(), getReturnType(), name
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-1
@@ -40,7 +40,8 @@ public class ErrorSimpleFunctionDescriptorImpl extends SimpleFunctionDescriptorI
|
|||||||
protected FunctionDescriptorImpl createSubstitutedCopy(
|
protected FunctionDescriptorImpl createSubstitutedCopy(
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@Nullable FunctionDescriptor original,
|
@Nullable FunctionDescriptor original,
|
||||||
@NotNull Kind kind
|
@NotNull Kind kind,
|
||||||
|
@Nullable Name newName
|
||||||
) {
|
) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -51,6 +52,12 @@ public class ErrorSimpleFunctionDescriptorImpl extends SimpleFunctionDescriptorI
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public SimpleFunctionDescriptor createRenamedCopy(@NotNull Name name) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addOverriddenDescriptor(@NotNull CallableMemberDescriptor overriddenFunction) {
|
public void addOverriddenDescriptor(@NotNull CallableMemberDescriptor overriddenFunction) {
|
||||||
// nop
|
// nop
|
||||||
|
|||||||
+3
-1
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.serialization.deserialization.descriptors
|
|||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||||
import org.jetbrains.kotlin.descriptors.impl.ConstructorDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.ConstructorDescriptorImpl
|
||||||
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
import org.jetbrains.kotlin.serialization.deserialization.NameResolver
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.TypeTable
|
import org.jetbrains.kotlin.serialization.deserialization.TypeTable
|
||||||
@@ -38,7 +39,8 @@ public class DeserializedConstructorDescriptor(
|
|||||||
override fun createSubstitutedCopy(
|
override fun createSubstitutedCopy(
|
||||||
newOwner: DeclarationDescriptor,
|
newOwner: DeclarationDescriptor,
|
||||||
original: FunctionDescriptor?,
|
original: FunctionDescriptor?,
|
||||||
kind: CallableMemberDescriptor.Kind
|
kind: CallableMemberDescriptor.Kind,
|
||||||
|
newName: Name?
|
||||||
): DeserializedConstructorDescriptor {
|
): DeserializedConstructorDescriptor {
|
||||||
return DeserializedConstructorDescriptor(
|
return DeserializedConstructorDescriptor(
|
||||||
newOwner as ClassDescriptor, original as ConstructorDescriptor?,
|
newOwner as ClassDescriptor, original as ConstructorDescriptor?,
|
||||||
|
|||||||
+3
-2
@@ -59,13 +59,14 @@ public class DeserializedSimpleFunctionDescriptor extends SimpleFunctionDescript
|
|||||||
protected FunctionDescriptorImpl createSubstitutedCopy(
|
protected FunctionDescriptorImpl createSubstitutedCopy(
|
||||||
@NotNull DeclarationDescriptor newOwner,
|
@NotNull DeclarationDescriptor newOwner,
|
||||||
@Nullable FunctionDescriptor original,
|
@Nullable FunctionDescriptor original,
|
||||||
@NotNull Kind kind
|
@NotNull Kind kind,
|
||||||
|
@Nullable Name newName
|
||||||
) {
|
) {
|
||||||
return new DeserializedSimpleFunctionDescriptor(
|
return new DeserializedSimpleFunctionDescriptor(
|
||||||
newOwner,
|
newOwner,
|
||||||
(DeserializedSimpleFunctionDescriptor) original,
|
(DeserializedSimpleFunctionDescriptor) original,
|
||||||
getAnnotations(),
|
getAnnotations(),
|
||||||
getName(),
|
newName != null ? newName : getName(),
|
||||||
kind,
|
kind,
|
||||||
proto,
|
proto,
|
||||||
nameResolver,
|
nameResolver,
|
||||||
|
|||||||
Reference in New Issue
Block a user