Skip to content

Commit

Permalink
Fixed containing declaration during copying of function descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
homuroll committed Apr 4, 2017
1 parent 6c1c86a commit b960d8b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ internal class DeepCopyIrTreeWithDescriptors(val targetFunction: IrFunction, val

private fun copySimpleFunctionDescriptor(oldDescriptor: SimpleFunctionDescriptor) : FunctionDescriptor {

val memberOwner = targetFunction.descriptor
val oldContainingDeclaration = oldDescriptor.containingDeclaration
val memberOwner = descriptorSubstituteMap[oldContainingDeclaration] ?: targetFunction.descriptor
val newDescriptor = SimpleFunctionDescriptorImpl.create(
memberOwner,
oldDescriptor.annotations,
Expand All @@ -164,7 +165,7 @@ internal class DeepCopyIrTreeWithDescriptors(val targetFunction: IrFunction, val
if (oldDispatchReceiverParameter == null) null
else descriptorSubstituteMap[oldDispatchReceiverParameter]
val newTypeParameters = oldDescriptor.typeParameters
val newValueParameters = copyValueParameters(oldDescriptor.valueParameters, memberOwner)
val newValueParameters = copyValueParameters(oldDescriptor.valueParameters, newDescriptor)

newDescriptor.initialize(
oldDescriptor.extensionReceiverParameter?.type,
Expand Down

0 comments on commit b960d8b

Please sign in to comment.