Minor, drop strange method from SerializerExtension
This commit is contained in:
@@ -38,7 +38,6 @@ import org.jetbrains.jet.config.CommonConfigurationKeys
|
||||
import org.jetbrains.jet.cli.common.messages.MessageCollector
|
||||
import org.jetbrains.jet.lang.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns
|
||||
import org.jetbrains.jet.utils.recursePostOrder
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.jet.lang.resolve.java.JvmAnalyzerFacade
|
||||
@@ -111,10 +110,7 @@ public class BuiltInsSerializer(val out: PrintStream?) {
|
||||
// TODO: perform some kind of validation? At the moment not possible because DescriptorValidator is in compiler-tests
|
||||
// DescriptorValidator.validate(packageView)
|
||||
|
||||
val serializer = DescriptorSerializer(object : SerializerExtension() {
|
||||
override fun hasSupertypes(descriptor: ClassDescriptor): Boolean =
|
||||
!KotlinBuiltIns.getInstance().isSpecialClassWithNoSupertypes(descriptor)
|
||||
})
|
||||
val serializer = DescriptorSerializer(SerializerExtension.DEFAULT)
|
||||
|
||||
val classNames = ArrayList<Name>()
|
||||
val classifierDescriptors = DescriptorSerializer.sort(packageView.getMemberScope().getDescriptors(DescriptorKindFilter.CLASSIFIERS))
|
||||
|
||||
+5
-6
@@ -24,7 +24,10 @@ import org.jetbrains.jet.lang.resolve.MemberComparator;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.*;
|
||||
|
||||
@@ -34,10 +37,6 @@ public class DescriptorSerializer {
|
||||
private final Interner<TypeParameterDescriptor> typeParameters;
|
||||
private final SerializerExtension extension;
|
||||
|
||||
public DescriptorSerializer() {
|
||||
this(SerializerExtension.DEFAULT);
|
||||
}
|
||||
|
||||
public DescriptorSerializer(@NotNull SerializerExtension extension) {
|
||||
this(new NameTable(), new Interner<TypeParameterDescriptor>(), extension);
|
||||
}
|
||||
@@ -75,7 +74,7 @@ public class DescriptorSerializer {
|
||||
builder.addTypeParameter(local.typeParameter(typeParameterDescriptor));
|
||||
}
|
||||
|
||||
if (extension.hasSupertypes(classDescriptor)) {
|
||||
if (!KotlinBuiltIns.getInstance().isSpecialClassWithNoSupertypes(classDescriptor)) {
|
||||
// Special classes (Any, Nothing) have no supertypes
|
||||
for (JetType supertype : classDescriptor.getTypeConstructor().getSupertypes()) {
|
||||
builder.addSupertype(local.type(supertype));
|
||||
|
||||
-5
@@ -18,16 +18,11 @@ package org.jetbrains.jet.descriptors.serialization;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
|
||||
public abstract class SerializerExtension {
|
||||
public static final SerializerExtension DEFAULT = new SerializerExtension() {};
|
||||
|
||||
public boolean hasSupertypes(@NotNull ClassDescriptor descriptor) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void serializeCallable(
|
||||
@NotNull CallableMemberDescriptor callable,
|
||||
@NotNull ProtoBuf.Callable.Builder proto,
|
||||
|
||||
Reference in New Issue
Block a user