Serialize/deserialize annotations on types

This commit is contained in:
Alexander Udalov
2015-04-09 21:12:08 +03:00
parent 88abcdbde5
commit 0732b78853
25 changed files with 420 additions and 128 deletions
@@ -299,7 +299,7 @@ public class DescriptorSerializer {
case IN_VARIANCE:
return ProtoBuf.TypeParameter.Variance.IN;
case OUT_VARIANCE:
return ProtoBuf.TypeParameter.Variance.OUT;
return ProtoBuf.TypeParameter.Variance.OUT;
}
throw new IllegalStateException("Unknown variance: " + variance);
}
@@ -323,6 +323,8 @@ public class DescriptorSerializer {
builder.setNullable(true);
}
extension.serializeType(type, builder, stringTable);
return builder;
}
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor;
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor;
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor;
import org.jetbrains.kotlin.types.JetType;
import java.util.Collection;
@@ -53,6 +54,13 @@ public abstract class SerializerExtension {
) {
}
public void serializeType(
@NotNull JetType type,
@NotNull ProtoBuf.Type.Builder proto,
@NotNull StringTable stringTable
) {
}
@NotNull
public String getLocalClassName(@NotNull ClassDescriptor descriptor) {
throw new UnsupportedOperationException("Local classes are unsupported: " + descriptor);