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:
Alexander Udalov
2020-11-05 13:08:03 +01:00
parent 55974b4eda
commit 791be7c2dc
8 changed files with 115 additions and 21 deletions
@@ -738,6 +738,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
runTest("compiler/testData/codegen/bytecodeListing/deprecated/deprecatedEnumEntryFields.kt");
}
@TestMetadata("deprecatedInMultifileClass.kt")
public void testDeprecatedInMultifileClass() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/deprecated/deprecatedInMultifileClass.kt");
}
@TestMetadata("deprecatedLateinitVar.kt")
public void testDeprecatedLateinitVar() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/deprecated/deprecatedLateinitVar.kt");
@@ -708,6 +708,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
runTest("compiler/testData/codegen/bytecodeListing/deprecated/deprecatedEnumEntryFields.kt");
}
@TestMetadata("deprecatedInMultifileClass.kt")
public void testDeprecatedInMultifileClass() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/deprecated/deprecatedInMultifileClass.kt");
}
@TestMetadata("deprecatedLateinitVar.kt")
public void testDeprecatedLateinitVar() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/deprecated/deprecatedLateinitVar.kt");