Check if the class is special by FQ name
This is needed because our built-ins can be loaded with two different mechanisms (deserialization and lazy resolve) and, when that happens, corresponding descriptors aren't equal to each other, so one of two resolved descriptors for Any (or the same with Nothing) was never considered to be a "special class" with no supertypes
This commit is contained in:
@@ -43,6 +43,7 @@ import org.jetbrains.jet.di.InjectorForJavaDescriptorResolverUtil
|
||||
import org.jetbrains.jet.lang.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName
|
||||
import com.intellij.util.containers.ContainerUtil
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns
|
||||
|
||||
public class BuiltInsSerializer(val out: PrintStream?) {
|
||||
private var totalSize = 0
|
||||
@@ -96,11 +97,8 @@ public class BuiltInsSerializer(val out: PrintStream?) {
|
||||
// DescriptorValidator.validate(packageView)
|
||||
|
||||
val serializer = DescriptorSerializer(object : SerializerExtension() {
|
||||
private val set = setOf("Any", "Nothing")
|
||||
|
||||
override fun hasSupertypes(descriptor: ClassDescriptor): Boolean {
|
||||
return descriptor.getName().asString() !in set
|
||||
}
|
||||
override fun hasSupertypes(descriptor: ClassDescriptor): Boolean =
|
||||
!KotlinBuiltIns.isSpecialClassWithNoSupertypes(descriptor)
|
||||
})
|
||||
|
||||
val classNames = ArrayList<Name>()
|
||||
|
||||
Reference in New Issue
Block a user