kill ClassDescriptor.superclassType

it is not used anywhere, I'll restore it when it is needed
This commit is contained in:
Stepan Koltsov
2012-01-14 04:27:10 +04:00
parent 2ab2030cea
commit 2fe9344225
6 changed files with 2 additions and 47 deletions
@@ -22,7 +22,6 @@ public class JavaClassDescriptor extends MutableDeclarationDescriptor implements
private final Set<ConstructorDescriptor> constructors = Sets.newLinkedHashSet(); private final Set<ConstructorDescriptor> constructors = Sets.newLinkedHashSet();
private Modality modality; private Modality modality;
private Visibility visibility; private Visibility visibility;
private JetType superclassType;
private final ClassKind kind; private final ClassKind kind;
private ClassReceiver implicitReceiver; private ClassReceiver implicitReceiver;
@@ -83,16 +82,6 @@ public class JavaClassDescriptor extends MutableDeclarationDescriptor implements
return new SubstitutingScope(unsubstitutedMemberScope, substitutor); return new SubstitutingScope(unsubstitutedMemberScope, substitutor);
} }
@NotNull
@Override
public JetType getSuperclassType() {
return superclassType;
}
public void setSuperclassType(@NotNull JetType superclassType) {
this.superclassType = superclassType;
}
@NotNull @NotNull
@Override @Override
public Set<ConstructorDescriptor> getConstructors() { public Set<ConstructorDescriptor> getConstructors() {
@@ -269,7 +269,7 @@ public class JavaDescriptorResolver {
supertypes.addAll(getSupertypes(psiClass)); supertypes.addAll(getSupertypes(psiClass));
if (psiClass.isInterface()) { if (psiClass.isInterface()) {
classData.classDescriptor.setSuperclassType(JetStandardClasses.getAnyType()); // TODO : Make it java.lang.Object //classData.classDescriptor.setSuperclassType(JetStandardClasses.getAnyType()); // TODO : Make it java.lang.Object
} }
else { else {
PsiClassType[] extendsListTypes = psiClass.getExtendsListTypes(); PsiClassType[] extendsListTypes = psiClass.getExtendsListTypes();
@@ -277,7 +277,7 @@ public class JavaDescriptorResolver {
JetType superclassType = extendsListTypes.length == 0 JetType superclassType = extendsListTypes.length == 0
? JetStandardClasses.getAnyType() ? JetStandardClasses.getAnyType()
: semanticServices.getTypeTransformer().transformToType(extendsListTypes[0]); : semanticServices.getTypeTransformer().transformToType(extendsListTypes[0]);
classData.classDescriptor.setSuperclassType(superclassType); //classData.classDescriptor.setSuperclassType(superclassType);
} }
PsiMethod[] psiConstructors = psiClass.getConstructors(); PsiMethod[] psiConstructors = psiClass.getConstructors();
@@ -20,12 +20,6 @@ public interface ClassDescriptor extends ClassifierDescriptor, MemberDescriptor
@NotNull @NotNull
JetScope getMemberScope(List<TypeProjection> typeArguments); JetScope getMemberScope(List<TypeProjection> typeArguments);
/**
* @return the superclass for a class descriptor, and the required class fro a trait descriptor
*/
@NotNull
JetType getSuperclassType();
@NotNull @NotNull
Set<ConstructorDescriptor> getConstructors(); Set<ConstructorDescriptor> getConstructors();
@@ -20,7 +20,6 @@ public class ClassDescriptorImpl extends DeclarationDescriptorImpl implements Cl
private JetScope memberDeclarations; private JetScope memberDeclarations;
private Set<ConstructorDescriptor> constructors; private Set<ConstructorDescriptor> constructors;
private ConstructorDescriptor primaryConstructor; private ConstructorDescriptor primaryConstructor;
private JetType superclassType;
private ReceiverDescriptor implicitReceiver; private ReceiverDescriptor implicitReceiver;
public ClassDescriptorImpl( public ClassDescriptorImpl(
@@ -50,7 +49,6 @@ public class ClassDescriptorImpl extends DeclarationDescriptorImpl implements Cl
this.memberDeclarations = memberDeclarations; this.memberDeclarations = memberDeclarations;
this.constructors = constructors; this.constructors = constructors;
this.primaryConstructor = primaryConstructor; this.primaryConstructor = primaryConstructor;
this.superclassType = superclassType;
return this; return this;
} }
@@ -86,12 +84,6 @@ public class ClassDescriptorImpl extends DeclarationDescriptorImpl implements Cl
return new SubstitutingScope(memberDeclarations, TypeSubstitutor.create(substitutionContext)); return new SubstitutingScope(memberDeclarations, TypeSubstitutor.create(substitutionContext));
} }
@NotNull
@Override
public JetType getSuperclassType() {
return superclassType;
}
@NotNull @NotNull
@Override @Override
public JetType getDefaultType() { public JetType getDefaultType() {
@@ -81,15 +81,6 @@ public class LazySubstitutingClassDescriptor implements ClassDescriptor {
return new SubstitutingScope(memberScope, getSubstitutor()); return new SubstitutingScope(memberScope, getSubstitutor());
} }
@NotNull
@Override
public JetType getSuperclassType() {
if (superclassType == null) {
superclassType = getSubstitutor().substitute(original.getSuperclassType(), Variance.INVARIANT);
}
return superclassType;
}
@NotNull @NotNull
@Override @Override
public JetType getDefaultType() { public JetType getDefaultType() {
@@ -347,17 +347,6 @@ public class MutableClassDescriptor extends MutableDeclarationDescriptor impleme
return kind; return kind;
} }
@NotNull
@Override
public JetType getSuperclassType() {
return superclassType;
}
public void setSuperclassType(@NotNull JetType superclassType) {
this.superclassType = superclassType;
}
public void setModality(Modality modality) { public void setModality(Modality modality) {
this.modality = modality; this.modality = modality;
} }