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
@@ -354,7 +354,7 @@ public final class BindingUtils {
public static ConstructorDescriptor getConstructor(@NotNull BindingContext bindingContext,
@NotNull JetClassOrObject declaration) {
ConstructorDescriptor primaryConstructor =
getClassDescriptor(bindingContext, declaration).getUnsubstitutedPrimaryConstructor();
((ClassDescriptorFromSource) getClassDescriptor(bindingContext, declaration)).getUnsubstitutedPrimaryConstructor();
assert primaryConstructor != null : "Traits do not have initialize methods.";
return primaryConstructor;
}