unneeded parameter inlined
This commit is contained in:
@@ -905,7 +905,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
|||||||
.getCalleeExpression()
|
.getCalleeExpression()
|
||||||
.getConstructorReferenceExpression());
|
.getConstructorReferenceExpression());
|
||||||
assert superConstructor != null;
|
assert superConstructor != null;
|
||||||
CallableMethod superCallable = typeMapper.mapToCallableMethod(superConstructor, OwnerKind.IMPLEMENTATION,
|
CallableMethod superCallable = typeMapper.mapToCallableMethod(superConstructor,
|
||||||
typeMapper.hasThis0(superConstructor.getContainingDeclaration()));
|
typeMapper.hasThis0(superConstructor.getContainingDeclaration()));
|
||||||
Type[] argumentTypes = superCallable.getSignature().getAsmMethod().getArgumentTypes();
|
Type[] argumentTypes = superCallable.getSignature().getAsmMethod().getArgumentTypes();
|
||||||
Collections.addAll(consArgTypes, argumentTypes);
|
Collections.addAll(consArgTypes, argumentTypes);
|
||||||
@@ -2755,7 +2755,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CallableMethod method = typeMapper
|
CallableMethod method = typeMapper
|
||||||
.mapToCallableMethod((ConstructorDescriptor) constructorDescriptor, OwnerKind.IMPLEMENTATION, typeMapper
|
.mapToCallableMethod((ConstructorDescriptor) constructorDescriptor, typeMapper
|
||||||
.hasThis0(((ConstructorDescriptor) constructorDescriptor).getContainingDeclaration()));
|
.hasThis0(((ConstructorDescriptor) constructorDescriptor).getContainingDeclaration()));
|
||||||
invokeMethodWithArguments(method, expression, StackValue.none());
|
invokeMethodWithArguments(method, expression, StackValue.none());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ public class GenerationState {
|
|||||||
ConstructorDescriptor constructorDescriptor = bindingContext.get(BindingContext.CONSTRUCTOR, objectDeclaration);
|
ConstructorDescriptor constructorDescriptor = bindingContext.get(BindingContext.CONSTRUCTOR, objectDeclaration);
|
||||||
assert constructorDescriptor != null;
|
assert constructorDescriptor != null;
|
||||||
CallableMethod callableMethod = typeMapper.mapToCallableMethod(
|
CallableMethod callableMethod = typeMapper.mapToCallableMethod(
|
||||||
constructorDescriptor, OwnerKind.IMPLEMENTATION,
|
constructorDescriptor,
|
||||||
typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
||||||
return new GeneratedAnonymousClassDescriptor(nameAndVisitor.first, callableMethod.getSignature().getAsmMethod(),
|
return new GeneratedAnonymousClassDescriptor(nameAndVisitor.first, callableMethod.getSignature().getAsmMethod(),
|
||||||
objectContext.outerWasUsed, null);
|
objectContext.outerWasUsed, null);
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
callableMethod = typeMapper.mapToCallableMethod(constructorDescriptor, kind,
|
callableMethod = typeMapper.mapToCallableMethod(constructorDescriptor,
|
||||||
typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
||||||
constructorMethod = callableMethod.getSignature();
|
constructorMethod = callableMethod.getSignature();
|
||||||
}
|
}
|
||||||
@@ -608,7 +608,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
declarationDescriptor = ((ClassDescriptorFromSource) declarationDescriptor).getUnsubstitutedPrimaryConstructor();
|
declarationDescriptor = ((ClassDescriptorFromSource) declarationDescriptor).getUnsubstitutedPrimaryConstructor();
|
||||||
}
|
}
|
||||||
ConstructorDescriptor superConstructor = (ConstructorDescriptor) declarationDescriptor;
|
ConstructorDescriptor superConstructor = (ConstructorDescriptor) declarationDescriptor;
|
||||||
CallableMethod superCallable = typeMapper.mapToCallableMethod(superConstructor, OwnerKind.IMPLEMENTATION, typeMapper
|
CallableMethod superCallable = typeMapper.mapToCallableMethod(superConstructor, typeMapper
|
||||||
.hasThis0(superConstructor.getContainingDeclaration()));
|
.hasThis0(superConstructor.getContainingDeclaration()));
|
||||||
firstSuperArgument = insert;
|
firstSuperArgument = insert;
|
||||||
for (Type t : superCallable.getSignature().getAsmMethod().getArgumentTypes()) {
|
for (Type t : superCallable.getSignature().getAsmMethod().getArgumentTypes()) {
|
||||||
@@ -1075,7 +1075,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CallableMethod method = typeMapper
|
CallableMethod method = typeMapper
|
||||||
.mapToCallableMethod(constructorDescriptor, kind, typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
.mapToCallableMethod(constructorDescriptor, typeMapper.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
||||||
|
|
||||||
if (myClass instanceof JetObjectDeclaration &&
|
if (myClass instanceof JetObjectDeclaration &&
|
||||||
superCall instanceof JetDelegatorToSuperCall &&
|
superCall instanceof JetDelegatorToSuperCall &&
|
||||||
@@ -1085,7 +1085,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
.getCalleeExpression()
|
.getCalleeExpression()
|
||||||
.getConstructorReferenceExpression());
|
.getConstructorReferenceExpression());
|
||||||
assert superConstructor != null;
|
assert superConstructor != null;
|
||||||
CallableMethod superCallable = typeMapper.mapToCallableMethod(superConstructor, OwnerKind.IMPLEMENTATION,
|
CallableMethod superCallable = typeMapper.mapToCallableMethod(superConstructor,
|
||||||
typeMapper.hasThis0(superConstructor.getContainingDeclaration()));
|
typeMapper.hasThis0(superConstructor.getContainingDeclaration()));
|
||||||
int nextVar = firstSuperArgument + 1;
|
int nextVar = firstSuperArgument + 1;
|
||||||
for (Type t : superCallable.getSignature().getAsmMethod().getArgumentTypes()) {
|
for (Type t : superCallable.getSignature().getAsmMethod().getArgumentTypes()) {
|
||||||
@@ -1168,7 +1168,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
ConstructorDescriptor constructorDescriptor = (ConstructorDescriptor) bindingContext
|
ConstructorDescriptor constructorDescriptor = (ConstructorDescriptor) bindingContext
|
||||||
.get(BindingContext.REFERENCE_TARGET, superCall.getCalleeExpression().getConstructorReferenceExpression());
|
.get(BindingContext.REFERENCE_TARGET, superCall.getCalleeExpression().getConstructorReferenceExpression());
|
||||||
assert constructorDescriptor != null;
|
assert constructorDescriptor != null;
|
||||||
CallableMethod method = typeMapper.mapToCallableMethod(constructorDescriptor, OwnerKind.IMPLEMENTATION, typeMapper
|
CallableMethod method = typeMapper.mapToCallableMethod(constructorDescriptor, typeMapper
|
||||||
.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
.hasThis0(constructorDescriptor.getContainingDeclaration()));
|
||||||
codegen.invokeMethodWithArguments(method, superCall, StackValue.none());
|
codegen.invokeMethodWithArguments(method, superCall, StackValue.none());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1022,11 +1022,10 @@ public class JetTypeMapper {
|
|||||||
return signatureWriter.makeJvmMethodSignature("<init>");
|
return signatureWriter.makeJvmMethodSignature("<init>");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CallableMethod mapToCallableMethod(ConstructorDescriptor descriptor, OwnerKind kind, boolean hasThis0) {
|
public CallableMethod mapToCallableMethod(ConstructorDescriptor descriptor, boolean hasThis0) {
|
||||||
final JvmMethodSignature method = mapConstructorSignature(descriptor, hasThis0);
|
final JvmMethodSignature method = mapConstructorSignature(descriptor, hasThis0);
|
||||||
MapTypeMode mapTypeMode = ownerKindToMapTypeMode(kind);
|
|
||||||
JetType defaultType = descriptor.getContainingDeclaration().getDefaultType();
|
JetType defaultType = descriptor.getContainingDeclaration().getDefaultType();
|
||||||
Type mapped = mapType(defaultType, mapTypeMode);
|
Type mapped = mapType(defaultType, MapTypeMode.IMPL);
|
||||||
if (mapped.getSort() != Type.OBJECT) {
|
if (mapped.getSort() != Type.OBJECT) {
|
||||||
throw new IllegalStateException("type must have been mapped to object: " + defaultType + ", actual: " + mapped);
|
throw new IllegalStateException("type must have been mapped to object: " + defaultType + ", actual: " + mapped);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user