KT-11588 Type aliases

Deserialization
This commit is contained in:
Dmitry Petrov
2016-05-17 18:08:07 +03:00
parent f296b17861
commit 32f61c3918
30 changed files with 348 additions and 101 deletions
@@ -380,6 +380,14 @@ public class DescriptorSerializer {
builder.setUnderlyingType(type(underlyingType));
}
KotlinType expandedType = descriptor.getExpandedType();
if (useTypeTable()) {
builder.setExpandedTypeId(typeId(expandedType));
}
else {
builder.setExpandedType(type(expandedType));
}
return builder;
}
@@ -535,6 +543,16 @@ public class DescriptorSerializer {
builder.setNullable(type.isMarkedNullable());
}
KotlinType abbreviatedType = TypeCapabilitiesKt.getAbbreviatedType(type);
if (abbreviatedType != null) {
if (useTypeTable()) {
builder.setAbbreviatedTypeId(typeId(abbreviatedType));
}
else {
builder.setAbbreviatedType(type(abbreviatedType));
}
}
extension.serializeType(type, builder);
return builder;
@@ -549,7 +567,7 @@ public class DescriptorSerializer {
if (classifierDescriptor instanceof ClassDescriptor) {
builder.setClassName(classifierId);
}
else {
else if (classifierDescriptor instanceof TypeAliasDescriptor) {
builder.setTypeAliasName(classifierId);
}