Minor, refine return type of AbstractClassTypeConstructor.getDeclarationDescriptor

This commit is contained in:
Alexander Udalov
2017-10-13 20:13:02 +02:00
parent dc02b2e3ab
commit 0a861fd4ed
4 changed files with 7 additions and 7 deletions
@@ -257,9 +257,9 @@ class LazyJavaClassDescriptor(
override fun isFinal(): Boolean = isFinalClass
override fun isDenotable() = true
override fun isDenotable(): Boolean = true
override fun getDeclarationDescriptor() = this@LazyJavaClassDescriptor
override fun getDeclarationDescriptor(): ClassDescriptor = this@LazyJavaClassDescriptor
override fun toString(): String = name.asString()
}
@@ -39,7 +39,7 @@ public abstract class AbstractClassTypeConstructor extends AbstractTypeConstruct
if (currentHashCode != 0) return currentHashCode;
ClassifierDescriptor descriptor = getDeclarationDescriptor();
if (descriptor instanceof ClassDescriptor && hasMeaningfulFqName(descriptor)) {
if (hasMeaningfulFqName(descriptor)) {
currentHashCode = DescriptorUtils.getFqName(descriptor).hashCode();
}
else {
@@ -51,7 +51,7 @@ public abstract class AbstractClassTypeConstructor extends AbstractTypeConstruct
@NotNull
@Override
public abstract ClassifierDescriptor getDeclarationDescriptor();
public abstract ClassDescriptor getDeclarationDescriptor();
@NotNull
@Override
@@ -81,7 +81,7 @@ public abstract class AbstractClassTypeConstructor extends AbstractTypeConstruct
return false;
}
if (myDescriptor instanceof ClassDescriptor && otherDescriptor instanceof ClassDescriptor) {
if (otherDescriptor instanceof ClassDescriptor) {
return areFqNamesEqual(((ClassDescriptor) myDescriptor), ((ClassDescriptor) otherDescriptor));
}