JVM IR: keep property annotations for inline class replacements
In particular, `@Deprecated` is not lost anymore and accessors of deprecated property are generated with ACC_DEPRECATED just as in the old backend. #KT-43327 Fixed
This commit is contained in:
+2
-1
@@ -219,7 +219,7 @@ class MemoizedInlineClassReplacements(private val mangleReturnTypes: Boolean, pr
|
|||||||
returnType = function.returnType
|
returnType = function.returnType
|
||||||
}.apply {
|
}.apply {
|
||||||
parent = function.parent
|
parent = function.parent
|
||||||
annotations += function.annotations
|
annotations = function.annotations
|
||||||
copyTypeParameters(function.allTypeParameters)
|
copyTypeParameters(function.allTypeParameters)
|
||||||
if (function.metadata != null) {
|
if (function.metadata != null) {
|
||||||
metadata = function.metadata
|
metadata = function.metadata
|
||||||
@@ -237,6 +237,7 @@ class MemoizedInlineClassReplacements(private val mangleReturnTypes: Boolean, pr
|
|||||||
}.apply {
|
}.apply {
|
||||||
parent = propertySymbol.owner.parent
|
parent = propertySymbol.owner.parent
|
||||||
copyAttributes(propertySymbol.owner)
|
copyAttributes(propertySymbol.owner)
|
||||||
|
annotations = propertySymbol.owner.annotations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
correspondingPropertySymbol = property.symbol
|
correspondingPropertySymbol = property.symbol
|
||||||
|
|||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
|
||||||
|
abstract class A {
|
||||||
|
@Deprecated("")
|
||||||
|
abstract var warn: UByte
|
||||||
|
|
||||||
|
@Deprecated("", level = DeprecationLevel.HIDDEN)
|
||||||
|
abstract var hidden: UByte
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
@kotlin.Metadata
|
||||||
|
public abstract class A {
|
||||||
|
// source: 'inlineClassTypesInSignature.kt'
|
||||||
|
public method <init>(): void
|
||||||
|
public synthetic deprecated static @kotlin.Deprecated method getHidden-w2LRezQ$annotations(): void
|
||||||
|
public synthetic deprecated abstract method getHidden-w2LRezQ(): byte
|
||||||
|
public synthetic deprecated static @kotlin.Deprecated method getWarn-w2LRezQ$annotations(): void
|
||||||
|
public deprecated abstract method getWarn-w2LRezQ(): byte
|
||||||
|
public synthetic deprecated abstract method setHidden-7apg3OU(p0: byte): void
|
||||||
|
public deprecated abstract method setWarn-7apg3OU(p0: byte): void
|
||||||
|
}
|
||||||
+5
@@ -782,6 +782,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
|||||||
public void testHidden() throws Exception {
|
public void testHidden() throws Exception {
|
||||||
runTest("compiler/testData/codegen/bytecodeListing/deprecated/hidden.kt");
|
runTest("compiler/testData/codegen/bytecodeListing/deprecated/hidden.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineClassTypesInSignature.kt")
|
||||||
|
public void testInlineClassTypesInSignature() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeListing/deprecated/inlineClassTypesInSignature.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/bytecodeListing/inline")
|
@TestMetadata("compiler/testData/codegen/bytecodeListing/inline")
|
||||||
|
|||||||
+5
@@ -752,6 +752,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
|
|||||||
public void testHidden() throws Exception {
|
public void testHidden() throws Exception {
|
||||||
runTest("compiler/testData/codegen/bytecodeListing/deprecated/hidden.kt");
|
runTest("compiler/testData/codegen/bytecodeListing/deprecated/hidden.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineClassTypesInSignature.kt")
|
||||||
|
public void testInlineClassTypesInSignature() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeListing/deprecated/inlineClassTypesInSignature.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/bytecodeListing/inline")
|
@TestMetadata("compiler/testData/codegen/bytecodeListing/inline")
|
||||||
|
|||||||
Reference in New Issue
Block a user