Igor's fixes
This commit is contained in:
committed by
KonstantinAnisimov
parent
526a496d59
commit
90b910fd53
+15
-13
@@ -174,7 +174,8 @@ internal class DeepCopyIrTreeWithDescriptors(val targetFunction: IrFunction, val
|
|||||||
|
|
||||||
private fun copySimpleFunctionDescriptor(oldDescriptor: SimpleFunctionDescriptor) : FunctionDescriptor {
|
private fun copySimpleFunctionDescriptor(oldDescriptor: SimpleFunctionDescriptor) : FunctionDescriptor {
|
||||||
|
|
||||||
val containingDeclaration = targetFunction.descriptor
|
val oldContainingDeclaration = oldDescriptor.containingDeclaration
|
||||||
|
val memberOwner = descriptorSubstituteMap[oldContainingDeclaration] ?: targetFunction.descriptor
|
||||||
val newDescriptor = SimpleFunctionDescriptorImpl.create(
|
val newDescriptor = SimpleFunctionDescriptorImpl.create(
|
||||||
containingDeclaration,
|
containingDeclaration,
|
||||||
oldDescriptor.annotations,
|
oldDescriptor.annotations,
|
||||||
@@ -183,20 +184,20 @@ internal class DeepCopyIrTreeWithDescriptors(val targetFunction: IrFunction, val
|
|||||||
oldDescriptor.source
|
oldDescriptor.source
|
||||||
).apply { isTailrec = oldDescriptor.isTailrec }
|
).apply { isTailrec = oldDescriptor.isTailrec }
|
||||||
|
|
||||||
val newDispatchReceiverParameter = null // TODO
|
val oldDispatchReceiverParameter = oldDescriptor.dispatchReceiverParameter
|
||||||
val newTypeParameters = oldDescriptor.typeParameters
|
val newDispatchReceiverParameter =
|
||||||
val newValueParameters = copyValueParameters(oldDescriptor.valueParameters, containingDeclaration)
|
if (oldDispatchReceiverParameter == null) null
|
||||||
val receiverParameterType = substituteType(oldDescriptor.extensionReceiverParameter?.type)
|
else descriptorSubstituteMap[oldDispatchReceiverParameter]
|
||||||
val returnType = substituteType(oldDescriptor.returnType)
|
val newTypeParameters = oldDescriptor.typeParameters
|
||||||
assert(newTypeParameters.isEmpty())
|
val newValueParameters = copyValueParameters(oldDescriptor.valueParameters, newDescriptor)
|
||||||
|
|
||||||
newDescriptor.initialize(
|
newDescriptor.initialize(
|
||||||
receiverParameterType,
|
oldDescriptor.extensionReceiverParameter?.type,
|
||||||
newDispatchReceiverParameter,
|
newDispatchReceiverParameter as? ReceiverParameterDescriptor,
|
||||||
newTypeParameters,
|
newTypeParameters,
|
||||||
newValueParameters,
|
newValueParameters,
|
||||||
returnType,
|
oldDescriptor.returnType,
|
||||||
oldDescriptor.modality,
|
Modality.FINAL,
|
||||||
oldDescriptor.visibility
|
oldDescriptor.visibility
|
||||||
)
|
)
|
||||||
newDescriptor.overriddenDescriptors += oldDescriptor.overriddenDescriptors
|
newDescriptor.overriddenDescriptors += oldDescriptor.overriddenDescriptors
|
||||||
@@ -298,8 +299,9 @@ internal class DeepCopyIrTreeWithDescriptors(val targetFunction: IrFunction, val
|
|||||||
val oldExpression = super.visitCall(expression) as IrCall
|
val oldExpression = super.visitCall(expression) as IrCall
|
||||||
if (oldExpression !is IrCallImpl) return oldExpression // TODO what other kinds of call can we meet?
|
if (oldExpression !is IrCallImpl) return oldExpression // TODO what other kinds of call can we meet?
|
||||||
|
|
||||||
val oldDescriptor = oldExpression.descriptor
|
val oldDescriptor = irCall.descriptor
|
||||||
val newDescriptor = descriptorSubstituteMap.getOrDefault(oldDescriptor, oldDescriptor)
|
val newDescriptor = descriptorSubstituteMap.getOrDefault(oldDescriptor.original,
|
||||||
|
oldDescriptor) as FunctionDescriptor
|
||||||
|
|
||||||
val oldSuperQualifier = oldExpression.superQualifier
|
val oldSuperQualifier = oldExpression.superQualifier
|
||||||
var newSuperQualifier: ClassDescriptor? = oldSuperQualifier
|
var newSuperQualifier: ClassDescriptor? = oldSuperQualifier
|
||||||
|
|||||||
Reference in New Issue
Block a user