Do not consider 'expect' class type constructors final
Because even a final expected class can be actualized with an open actual class and thus have subtypes in the platform code
This commit is contained in:
-2
@@ -255,8 +255,6 @@ class LazyJavaClassDescriptor(
|
||||
override val supertypeLoopChecker: SupertypeLoopChecker
|
||||
get() = c.components.supertypeLoopChecker
|
||||
|
||||
override fun isFinal(): Boolean = isFinalClass
|
||||
|
||||
override fun isDenotable(): Boolean = true
|
||||
|
||||
override fun getDeclarationDescriptor(): ClassDescriptor = this@LazyJavaClassDescriptor
|
||||
|
||||
-1
@@ -152,7 +152,6 @@ class FunctionClassDescriptor(
|
||||
|
||||
override fun getDeclarationDescriptor() = this@FunctionClassDescriptor
|
||||
override fun isDenotable() = true
|
||||
override fun isFinal() = false
|
||||
|
||||
override fun toString() = declarationDescriptor.toString()
|
||||
|
||||
|
||||
@@ -53,6 +53,12 @@ public abstract class AbstractClassTypeConstructor extends AbstractTypeConstruct
|
||||
@Override
|
||||
public abstract ClassDescriptor getDeclarationDescriptor();
|
||||
|
||||
@Override
|
||||
public final boolean isFinal() {
|
||||
ClassDescriptor descriptor = getDeclarationDescriptor();
|
||||
return descriptor.getModality() == Modality.FINAL && !descriptor.isExpect();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public KotlinBuiltIns getBuiltIns() {
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.types;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.Modality;
|
||||
import org.jetbrains.kotlin.descriptors.SupertypeLoopChecker;
|
||||
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
@@ -56,11 +55,6 @@ public class ClassTypeConstructorImpl extends AbstractClassTypeConstructor imple
|
||||
return DescriptorUtils.getFqName(classDescriptor).asString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinal() {
|
||||
return classDescriptor.getModality() == Modality.FINAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDenotable() {
|
||||
return true;
|
||||
|
||||
-2
@@ -195,8 +195,6 @@ class DeserializedClassDescriptor(
|
||||
|
||||
override fun getParameters() = parameters()
|
||||
|
||||
override fun isFinal(): Boolean = isFinalClass
|
||||
|
||||
override fun isDenotable() = true
|
||||
|
||||
override fun getDeclarationDescriptor() = this@DeserializedClassDescriptor
|
||||
|
||||
Reference in New Issue
Block a user