JVM IR: generate synthetic $annotations methods for properties
This commit is contained in:
@@ -350,7 +350,7 @@ public class PropertyCodegen {
|
||||
Annotations annotations = descriptor.getAnnotations();
|
||||
if (annotations.isEmpty()) return;
|
||||
|
||||
Method signature = getSyntheticMethodSignature(descriptor);
|
||||
Method signature = typeMapper.mapSyntheticMethodForPropertyAnnotations(descriptor);
|
||||
if (kind != OwnerKind.DEFAULT_IMPLS && CodegenContextUtil.isImplementationOwner(context, descriptor)) {
|
||||
v.getSerializationBindings().put(SYNTHETIC_METHOD_FOR_PROPERTY, descriptor, signature);
|
||||
}
|
||||
@@ -363,14 +363,6 @@ public class PropertyCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Method getSyntheticMethodSignature(@NotNull PropertyDescriptor descriptor) {
|
||||
ReceiverParameterDescriptor receiver = descriptor.getExtensionReceiverParameter();
|
||||
String name = JvmAbi.getSyntheticMethodNameForAnnotatedProperty(descriptor.getName());
|
||||
String desc = receiver == null ? "()V" : "(" + typeMapper.mapType(receiver.getType()) + ")V";
|
||||
return new Method(name, desc);
|
||||
}
|
||||
|
||||
private void generateBackingField(
|
||||
@NotNull KtNamedDeclaration element,
|
||||
@NotNull PropertyDescriptor propertyDescriptor,
|
||||
|
||||
@@ -1834,6 +1834,14 @@ public class KotlinTypeMapper {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Method mapSyntheticMethodForPropertyAnnotations(@NotNull PropertyDescriptor descriptor) {
|
||||
ReceiverParameterDescriptor receiver = descriptor.getExtensionReceiverParameter();
|
||||
String name = JvmAbi.getSyntheticMethodNameForAnnotatedProperty(descriptor.getName());
|
||||
String desc = receiver == null ? "()V" : "(" + mapType(receiver.getType()) + ")V";
|
||||
return new Method(name, desc);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public JvmMethodSignature mapScriptSignature(
|
||||
@NotNull ScriptDescriptor script,
|
||||
|
||||
Reference in New Issue
Block a user