Minor, rename parameter

This commit is contained in:
Alexander Udalov
2014-07-14 21:43:53 +04:00
parent 288bbcae36
commit b29f3dddeb
@@ -739,34 +739,31 @@ public class JetTypeMapper {
sw.writeParameterTypeEnd(); sw.writeParameterTypeEnd();
} }
private void writeAdditionalConstructorParameters( private void writeAdditionalConstructorParameters(@NotNull ConstructorDescriptor descriptor, @NotNull BothSignatureWriter sw) {
@NotNull ConstructorDescriptor descriptor,
@NotNull BothSignatureWriter signatureWriter
) {
CalculatedClosure closure = bindingContext.get(CodegenBinding.CLOSURE, descriptor.getContainingDeclaration()); CalculatedClosure closure = bindingContext.get(CodegenBinding.CLOSURE, descriptor.getContainingDeclaration());
ClassDescriptor captureThis = getExpectedThisObjectForConstructorCall(descriptor, closure); ClassDescriptor captureThis = getExpectedThisObjectForConstructorCall(descriptor, closure);
if (captureThis != null) { if (captureThis != null) {
signatureWriter.writeParameterType(JvmMethodParameterKind.OUTER); sw.writeParameterType(JvmMethodParameterKind.OUTER);
mapType(captureThis.getDefaultType(), signatureWriter, JetTypeMapperMode.VALUE); mapType(captureThis.getDefaultType(), sw, JetTypeMapperMode.VALUE);
signatureWriter.writeParameterTypeEnd(); sw.writeParameterTypeEnd();
} }
JetType captureReceiverType = closure != null ? closure.getCaptureReceiverType() : null; JetType captureReceiverType = closure != null ? closure.getCaptureReceiverType() : null;
if (captureReceiverType != null) { if (captureReceiverType != null) {
signatureWriter.writeParameterType(JvmMethodParameterKind.RECEIVER); sw.writeParameterType(JvmMethodParameterKind.RECEIVER);
mapType(captureReceiverType, signatureWriter, JetTypeMapperMode.VALUE); mapType(captureReceiverType, sw, JetTypeMapperMode.VALUE);
signatureWriter.writeParameterTypeEnd(); sw.writeParameterTypeEnd();
} }
ClassDescriptor containingDeclaration = descriptor.getContainingDeclaration(); ClassDescriptor containingDeclaration = descriptor.getContainingDeclaration();
if (containingDeclaration.getKind() == ClassKind.ENUM_CLASS || containingDeclaration.getKind() == ClassKind.ENUM_ENTRY) { if (containingDeclaration.getKind() == ClassKind.ENUM_CLASS || containingDeclaration.getKind() == ClassKind.ENUM_ENTRY) {
signatureWriter.writeParameterType(JvmMethodParameterKind.ENUM_NAME); sw.writeParameterType(JvmMethodParameterKind.ENUM_NAME);
mapType(KotlinBuiltIns.getInstance().getStringType(), signatureWriter, JetTypeMapperMode.VALUE); mapType(KotlinBuiltIns.getInstance().getStringType(), sw, JetTypeMapperMode.VALUE);
signatureWriter.writeParameterTypeEnd(); sw.writeParameterTypeEnd();
signatureWriter.writeParameterType(JvmMethodParameterKind.ENUM_ORDINAL); sw.writeParameterType(JvmMethodParameterKind.ENUM_ORDINAL);
mapType(KotlinBuiltIns.getInstance().getIntType(), signatureWriter, JetTypeMapperMode.VALUE); mapType(KotlinBuiltIns.getInstance().getIntType(), sw, JetTypeMapperMode.VALUE);
signatureWriter.writeParameterTypeEnd(); sw.writeParameterTypeEnd();
} }
if (closure == null) return; if (closure == null) return;
@@ -788,18 +785,18 @@ public class JetTypeMapper {
} }
if (type != null) { if (type != null) {
signatureWriter.writeParameterType(JvmMethodParameterKind.CAPTURED_LOCAL_VARIABLE); sw.writeParameterType(JvmMethodParameterKind.CAPTURED_LOCAL_VARIABLE);
signatureWriter.writeAsmType(type); sw.writeAsmType(type);
signatureWriter.writeParameterTypeEnd(); sw.writeParameterTypeEnd();
} }
} }
ResolvedCall<ConstructorDescriptor> superCall = closure.getSuperCall(); ResolvedCall<ConstructorDescriptor> superCall = closure.getSuperCall();
if (superCall != null && isAnonymousObject(descriptor.getContainingDeclaration())) { if (superCall != null && isAnonymousObject(descriptor.getContainingDeclaration())) {
for (JvmMethodParameterSignature parameter : mapSignature(superCall.getResultingDescriptor()).getValueParameters()) { for (JvmMethodParameterSignature parameter : mapSignature(superCall.getResultingDescriptor()).getValueParameters()) {
signatureWriter.writeParameterType(JvmMethodParameterKind.SUPER_OF_ANONYMOUS_CALL_PARAM); sw.writeParameterType(JvmMethodParameterKind.SUPER_OF_ANONYMOUS_CALL_PARAM);
signatureWriter.writeAsmType(parameter.getAsmType()); sw.writeAsmType(parameter.getAsmType());
signatureWriter.writeParameterTypeEnd(); sw.writeParameterTypeEnd();
} }
} }
} }