Refactor ConstantValue implementations
Remove KotlinBuiltIns and take a ModuleDescriptor instance in getType instead. This will allow to create constant values in contexts where there's no module or built-ins accessible (such as, deserialization of module annotations during indexing of .kotlin_module files in IDE). Note that some values (KClassValue, EnumValue, AnnotationValue) still take module-dependent objects (KotlinType, ClassDescriptor and AnnotationDescriptor respectively). This is to be refactored later
This commit is contained in:
@@ -370,8 +370,9 @@ public abstract class AnnotationCodegen {
|
||||
|
||||
@Override
|
||||
public Void visitEnumValue(EnumValue value, Void data) {
|
||||
String propertyName = value.getValue().getName().asString();
|
||||
annotationVisitor.visitEnum(name, typeMapper.mapType(value.getType()).getDescriptor(), propertyName);
|
||||
String enumClassInternalName = AsmUtil.asmTypeByClassId(value.getEnumClassId()).getDescriptor();
|
||||
String enumEntryName = value.getEnumEntryName().asString();
|
||||
annotationVisitor.visitEnum(name, enumClassInternalName, enumEntryName);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user