diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt index d72c83a6df5..c8f9ec0b0b5 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt @@ -81,7 +81,7 @@ class MethodSignatureMapper(private val context: JvmBackendContext) { } val property = (function as? IrSimpleFunction)?.correspondingPropertySymbol?.owner - if (property != null && function.name.isSpecial) { + if (property != null) { val propertyName = property.name.asString() val propertyParent = property.parentAsClass if (propertyParent.isAnnotationClass) @@ -93,8 +93,10 @@ class MethodSignatureMapper(private val context: JvmBackendContext) { if ((propertyParent.isEnumClass || propertyParent.isEnumEntry) && (propertyName == "name" || propertyName == "ordinal")) return propertyName - val accessorName = if (function.isGetter) JvmAbi.getterName(propertyName) else JvmAbi.setterName(propertyName) - return mangleMemberNameIfRequired(accessorName, function) + if (function.name.isSpecial) { + val accessorName = if (function.isGetter) JvmAbi.getterName(propertyName) else JvmAbi.setterName(propertyName) + return mangleMemberNameIfRequired(accessorName, function) + } } return mangleMemberNameIfRequired(function.name.asString(), function) diff --git a/compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.kt b/compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.kt new file mode 100644 index 00000000000..e47d9d41c20 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.kt @@ -0,0 +1,8 @@ +// WITH_RUNTIME + +annotation class Anno( + val b: UByte, + val i: UInt, + val l: ULong, + val s: UShort, +) diff --git a/compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.txt b/compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.txt new file mode 100644 index 00000000000..882ac2fc4ea --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.txt @@ -0,0 +1,9 @@ +@java.lang.annotation.Retention +@kotlin.Metadata +public annotation class Anno { + // source: 'unsignedTypes.kt' + public abstract method b(): byte + public abstract method i(): int + public abstract method l(): long + public abstract method s(): short +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java index 10afb25f346..e6036cf8e63 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java @@ -230,6 +230,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { public void testOnReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/annotations/onReceiver.kt"); } + + @TestMetadata("unsignedTypes.kt") + public void testUnsignedTypes() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.kt"); + } } @TestMetadata("compiler/testData/codegen/bytecodeListing/collectionStubs") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java index 131801aa1e6..ec1dff307d2 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java @@ -230,6 +230,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes public void testOnReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/annotations/onReceiver.kt"); } + + @TestMetadata("unsignedTypes.kt") + public void testUnsignedTypes() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.kt"); + } } @TestMetadata("compiler/testData/codegen/bytecodeListing/collectionStubs")