JVM IR: improve ABI of properties in multifile facades
When copying top level declarations from multifile parts to facades, also copy corresponding properties. This allows to keep their annotations, which are later used in codegen (for example, to generate ACC_DEPRECATED on property accessors), and allows to get rid of the hack where the JVM name of the property accessor was computed prematurely via methodSignatureMapper. Also, don't copy `$annotations` methods for non-const properties to facades because the old backend only generates them in parts (which might be a separate problem, see KT-27644). #KT-40262 Fixed
This commit is contained in:
@@ -14,7 +14,9 @@ interface MetadataSource {
|
||||
interface File : MetadataSource
|
||||
interface Class : MetadataSource
|
||||
interface Function : MetadataSource
|
||||
interface Property : MetadataSource
|
||||
interface Property : MetadataSource {
|
||||
val isConst: Boolean
|
||||
}
|
||||
}
|
||||
|
||||
sealed class DescriptorMetadataSource : MetadataSource {
|
||||
@@ -30,8 +32,12 @@ sealed class DescriptorMetadataSource : MetadataSource {
|
||||
|
||||
class Function(override val descriptor: FunctionDescriptor) : DescriptorMetadataSource(), MetadataSource.Function
|
||||
|
||||
class Property(override val descriptor: PropertyDescriptor) : DescriptorMetadataSource(), MetadataSource.Property
|
||||
class Property(override val descriptor: PropertyDescriptor) : DescriptorMetadataSource(), MetadataSource.Property {
|
||||
override val isConst: Boolean get() = descriptor.isConst
|
||||
}
|
||||
|
||||
class LocalDelegatedProperty(override val descriptor: VariableDescriptorWithAccessors) : DescriptorMetadataSource(),
|
||||
MetadataSource.Property
|
||||
MetadataSource.Property {
|
||||
override val isConst: Boolean get() = descriptor.isConst
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user