Minor, drop strange method from SerializerExtension

This commit is contained in:
Alexander Udalov
2014-11-24 12:47:43 +03:00
parent b56076bd6a
commit 36c65e4264
3 changed files with 6 additions and 16 deletions
@@ -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));
@@ -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,