From 82d7a269edd208ab649654f92975489fb9e9848e Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 2 Mar 2017 15:03:27 +0300 Subject: [PATCH] Minor. Make sure that implicit contract of mapSignature is satisfied For ordinary functions mapSignature doesn't use original descriptor and maps the given descriptor itself, but for constructor it obtained the original value parameters. Necessary `getOriginal` calls were added to the call-sites --- .../kotlin/codegen/state/KotlinTypeMapper.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java index 7614a3cb44d..85321b3dcb5 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java @@ -707,9 +707,9 @@ public class KotlinTypeMapper { @NotNull public CallableMethod mapToCallableMethod(@NotNull FunctionDescriptor descriptor, boolean superCall) { if (descriptor instanceof ConstructorDescriptor) { - JvmMethodSignature method = mapSignatureSkipGeneric(descriptor); + JvmMethodSignature method = mapSignatureSkipGeneric(descriptor.getOriginal()); Type owner = mapOwner(descriptor); - String defaultImplDesc = mapDefaultMethod(descriptor, OwnerKind.IMPLEMENTATION).getDescriptor(); + String defaultImplDesc = mapDefaultMethod(descriptor.getOriginal(), OwnerKind.IMPLEMENTATION).getDescriptor(); return new CallableMethod( owner, owner, defaultImplDesc, method, INVOKESPECIAL, null, null, null, false @@ -1042,10 +1042,6 @@ public class KotlinTypeMapper { return mapSignature(CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView(f), kind, skipGenericSignature); } - if (f instanceof ConstructorDescriptor) { - return mapSignatureWithCustomParameters(f, kind, f.getOriginal().getValueParameters(), skipGenericSignature); - } - return mapSignatureWithCustomParameters(f, kind, f.getValueParameters(), skipGenericSignature); } @@ -1426,7 +1422,7 @@ public class KotlinTypeMapper { List valueArguments = superCall.getValueArgumentsByIndex(); assert valueArguments != null : "Failed to arrange value arguments by index: " + superDescriptor; - List parameters = mapSignatureSkipGeneric(superDescriptor).getValueParameters(); + List parameters = mapSignatureSkipGeneric(superDescriptor.getOriginal()).getValueParameters(); int params = parameters.size(); int args = valueArguments.size();