Minor, fix NonExistentClass name and format
This commit is contained in:
+2
-1
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||
import org.jetbrains.kotlin.load.java.lazy.types.RawTypeImpl;
|
||||
import org.jetbrains.kotlin.load.kotlin.JavaFlexibleTypeDeserializer;
|
||||
import org.jetbrains.kotlin.load.kotlin.TypeSignatureMappingKt;
|
||||
import org.jetbrains.kotlin.name.ClassId;
|
||||
import org.jetbrains.kotlin.serialization.AnnotationSerializer;
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf;
|
||||
@@ -164,7 +165,7 @@ public class JvmSerializerExtension extends SerializerExtension {
|
||||
@Override
|
||||
public void serializeErrorType(@NotNull KotlinType type, @NotNull ProtoBuf.Type.Builder builder) {
|
||||
if (classBuilderMode == ClassBuilderMode.KAPT) {
|
||||
builder.setClassName(stringTable.getStringIndex("error.NonExistingClass"));
|
||||
builder.setClassName(stringTable.getStringIndex(TypeSignatureMappingKt.NON_EXISTENT_CLASS_NAME));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -47,6 +47,8 @@ interface TypeMappingConfiguration<out T : Any> {
|
||||
fun processErrorType(kotlinType: KotlinType, descriptor: ClassDescriptor)
|
||||
}
|
||||
|
||||
const val NON_EXISTENT_CLASS_NAME = "error/NonExistentClass"
|
||||
|
||||
fun <T : Any> mapType(
|
||||
kotlinType: KotlinType,
|
||||
factory: JvmTypeFactory<T>,
|
||||
@@ -81,7 +83,7 @@ fun <T : Any> mapType(
|
||||
|
||||
when {
|
||||
ErrorUtils.isError(descriptor) -> {
|
||||
val jvmType = factory.createObjectType("error/NonExistentClass")
|
||||
val jvmType = factory.createObjectType(NON_EXISTENT_CLASS_NAME)
|
||||
typeMappingConfiguration.processErrorType(kotlinType, descriptor as ClassDescriptor)
|
||||
descriptorTypeWriter?.writeClass(jvmType)
|
||||
return jvmType
|
||||
|
||||
Reference in New Issue
Block a user