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
This commit is contained in:
Denis Zharkov
2017-03-02 15:03:27 +03:00
parent 394c68c326
commit 82d7a269ed
@@ -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<ResolvedValueArgument> valueArguments = superCall.getValueArgumentsByIndex();
assert valueArguments != null : "Failed to arrange value arguments by index: " + superDescriptor;
List<JvmMethodParameterSignature> parameters = mapSignatureSkipGeneric(superDescriptor).getValueParameters();
List<JvmMethodParameterSignature> parameters = mapSignatureSkipGeneric(superDescriptor.getOriginal()).getValueParameters();
int params = parameters.size();
int args = valueArguments.size();