ClassDescriptorFromSoruce

getUnsubstitutedPrimaryConstructor is needed only when analyzing source.
Primary constructor only exists in source code.
This commit is contained in:
Stepan Koltsov
2012-06-16 00:22:22 +04:00
parent 2a91e15384
commit 0b697847b2
10 changed files with 51 additions and 27 deletions
@@ -529,7 +529,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
closure.superCall = (JetDelegatorToSuperCall) superCall;
DeclarationDescriptor declarationDescriptor = bindingContext.get(BindingContext.REFERENCE_TARGET, ((JetDelegatorToSuperCall) superCall).getCalleeExpression().getConstructorReferenceExpression());
if (declarationDescriptor instanceof ClassDescriptor) {
declarationDescriptor = ((ClassDescriptor)declarationDescriptor).getUnsubstitutedPrimaryConstructor();
declarationDescriptor = ((ClassDescriptorFromSource) declarationDescriptor).getUnsubstitutedPrimaryConstructor();
}
ConstructorDescriptor superConstructor = (ConstructorDescriptor) declarationDescriptor;
CallableMethod superCallable = typeMapper.mapToCallableMethod(superConstructor, OwnerKind.IMPLEMENTATION, typeMapper.hasThis0(superConstructor.getContainingDeclaration()));