diff --git a/compiler/testData/codegen/bytecodeListing/annotations/defaultTargets.kt b/compiler/testData/codegen/bytecodeListing/annotations/defaultTargets.kt index 2ef84daccfd..f3a90e3c7a1 100644 --- a/compiler/testData/codegen/bytecodeListing/annotations/defaultTargets.kt +++ b/compiler/testData/codegen/bytecodeListing/annotations/defaultTargets.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -UseGetterNameForPropertyAnnotationsMethodOnJvm +// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm @Target(AnnotationTarget.PROPERTY) annotation class AnnProperty @@ -33,4 +33,4 @@ annotation class Anno @Anno val p2: Int = 4 - get() = field \ No newline at end of file + get() = field diff --git a/compiler/testData/codegen/bytecodeListing/annotations/defaultTargets.txt b/compiler/testData/codegen/bytecodeListing/annotations/defaultTargets.txt index 0b3ac0d2c9f..a5381d5823d 100644 --- a/compiler/testData/codegen/bytecodeListing/annotations/defaultTargets.txt +++ b/compiler/testData/codegen/bytecodeListing/annotations/defaultTargets.txt @@ -3,10 +3,10 @@ public final class A { private final @AnnField @AnnParameterField @AnnTypeField field a: int private final @AnnField @AnnTypeField field x: int public method (@AnnParameterProperty @AnnParameterField p0: int): void - public synthetic deprecated static @AnnProperty @AnnFieldProperty @AnnParameterProperty method a$annotations(): void + public synthetic deprecated static @AnnProperty @AnnFieldProperty @AnnParameterProperty method getA$annotations(): void public final method getA(): int + public synthetic deprecated static @AnnProperty @AnnFieldProperty method getX$annotations(): void public final method getX(): int - public synthetic deprecated static @AnnProperty @AnnFieldProperty method x$annotations(): void } @kotlin.annotation.Target diff --git a/compiler/testData/codegen/bytecodeListing/annotations/onProperties.kt b/compiler/testData/codegen/bytecodeListing/annotations/onProperties.kt index a2eef61f554..0f135bf929c 100644 --- a/compiler/testData/codegen/bytecodeListing/annotations/onProperties.kt +++ b/compiler/testData/codegen/bytecodeListing/annotations/onProperties.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -UseGetterNameForPropertyAnnotationsMethodOnJvm +// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm import kotlin.reflect.KProperty @@ -22,4 +22,4 @@ public class A(@AnnParam @field:AnnField @property:AnnProp2 val x: Int, @param:A @AnnProp @property:AnnProp2 @delegate:AnnDelegate @property:AnnDelegate val s: String by CustomDelegate() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt b/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt index 23c02e69831..6c0a8159bad 100644 --- a/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt +++ b/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt @@ -7,15 +7,15 @@ public final class A { private field y: int static method (): void public method (@AnnParam p0: int, @AnnParam p1: int): void + public synthetic deprecated static @AnnProp @AnnProp2 method getP$annotations(): void public final @AnnGetter method getP(): int + public synthetic deprecated static @AnnProp @AnnProp2 @AnnDelegate method getS$annotations(): void public final @org.jetbrains.annotations.NotNull method getS(): java.lang.String + public synthetic deprecated static @AnnProp2 method getX$annotations(): void public final method getX(): int public final @AnnGetter method getY(): int - public synthetic deprecated static @AnnProp @AnnProp2 method p$annotations(): void - public synthetic deprecated static @AnnProp @AnnProp2 @AnnDelegate method s$annotations(): void public final @AnnSetter method setP(@AnnParam p0: int): void public final @AnnSetter method setY(p0: int): void - public synthetic deprecated static @AnnProp2 method x$annotations(): void } @java.lang.annotation.Retention diff --git a/compiler/testData/codegen/bytecodeListing/inline/InlineOnlyPropertyMultifile.kt b/compiler/testData/codegen/bytecodeListing/inline/InlineOnlyPropertyMultifile.kt index 65903b1f97b..f73516ef2bd 100644 --- a/compiler/testData/codegen/bytecodeListing/inline/InlineOnlyPropertyMultifile.kt +++ b/compiler/testData/codegen/bytecodeListing/inline/InlineOnlyPropertyMultifile.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -UseGetterNameForPropertyAnnotationsMethodOnJvm +// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm // WITH_RUNTIME @file:[JvmName("Foo") JvmMultifileClass] diff --git a/compiler/testData/codegen/bytecodeListing/inline/InlineOnlyPropertyMultifile.txt b/compiler/testData/codegen/bytecodeListing/inline/InlineOnlyPropertyMultifile.txt index c0f11548e7c..cf0f2cb64f9 100644 --- a/compiler/testData/codegen/bytecodeListing/inline/InlineOnlyPropertyMultifile.txt +++ b/compiler/testData/codegen/bytecodeListing/inline/InlineOnlyPropertyMultifile.txt @@ -6,7 +6,7 @@ public final class test/Foo { @kotlin.Metadata synthetic final class test/Foo__InlineOnlyPropertyMultifileKt { public final static method foo(): void + public synthetic deprecated static @kotlin.internal.InlineOnly method getProp$annotations(): void private final static method getProp(): java.lang.String - public synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void private final static method setProp(p0: java.lang.String): void } diff --git a/compiler/testData/codegen/bytecodeListing/inline/inlineOnlyProperty.kt b/compiler/testData/codegen/bytecodeListing/inline/inlineOnlyProperty.kt index 435c513200c..cc6ea56387d 100644 --- a/compiler/testData/codegen/bytecodeListing/inline/inlineOnlyProperty.kt +++ b/compiler/testData/codegen/bytecodeListing/inline/inlineOnlyProperty.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -UseGetterNameForPropertyAnnotationsMethodOnJvm +// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm // WITH_RUNTIME @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/codegen/bytecodeListing/inline/inlineOnlyProperty.txt b/compiler/testData/codegen/bytecodeListing/inline/inlineOnlyProperty.txt index 75bbe2f45ad..3983a4a73db 100644 --- a/compiler/testData/codegen/bytecodeListing/inline/inlineOnlyProperty.txt +++ b/compiler/testData/codegen/bytecodeListing/inline/inlineOnlyProperty.txt @@ -1,18 +1,18 @@ @kotlin.Metadata public final class Foo { public method (): void + public synthetic deprecated static @kotlin.internal.InlineOnly method getProp$annotations(): void private final method getProp(): java.lang.String private final @kotlin.internal.InlineOnly method getProp2(): java.lang.String - public synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void private final method setProp(p0: java.lang.String): void public final method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void } @kotlin.Metadata public final class InlineOnlyPropertyKt { + public synthetic deprecated static @kotlin.internal.InlineOnly method getProp$annotations(): void private final static method getProp(): java.lang.String private final static @kotlin.internal.InlineOnly method getProp2(): java.lang.String - public synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void private final static method setProp(p0: java.lang.String): void public final static method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void } diff --git a/compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassWithManyKindsOfMembers.kt b/compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassWithManyKindsOfMembers.kt index 0a8177035d9..4122d2f2a58 100644 --- a/compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassWithManyKindsOfMembers.kt +++ b/compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassWithManyKindsOfMembers.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +InlineClasses -UseGetterNameForPropertyAnnotationsMethodOnJvm +// !LANGUAGE: +InlineClasses +UseGetterNameForPropertyAnnotationsMethodOnJvm interface IFoo { fun overridingFun() @@ -77,4 +77,4 @@ inline class Z(@get:AGet val x: Int) : IFoo { var @receiver:AReceiver String.nonOverridingExtVar: Int get() = x set(v) {} -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassWithManyKindsOfMembers.txt b/compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassWithManyKindsOfMembers.txt index 1850c41333c..16101d1d5c4 100644 --- a/compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassWithManyKindsOfMembers.txt +++ b/compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassWithManyKindsOfMembers.txt @@ -55,35 +55,35 @@ public final class Z { public method equals(p0: java.lang.Object): boolean public static method equals-impl(p0: int, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean public final static method equals-impl0(p0: int, p1: int): boolean + public synthetic deprecated static @A method getNonOverridingExtVal$annotations(p0: java.lang.String): void public final static @AGet method getNonOverridingExtVal-impl(p0: int, @AReceiver @org.jetbrains.annotations.NotNull p1: java.lang.String): int + public synthetic deprecated static @A method getNonOverridingExtVar$annotations(p0: java.lang.String): void public final static @AGet method getNonOverridingExtVar-impl(p0: int, @AReceiver @org.jetbrains.annotations.NotNull p1: java.lang.String): int + public synthetic deprecated static @A method getNonOverridingVal$annotations(): void public final static @AGet method getNonOverridingVal-impl(p0: int): int + public synthetic deprecated static @A method getNonOverridingVar$annotations(): void public final static @AGet method getNonOverridingVar-impl(p0: int): int + public synthetic deprecated static @A method getOverridingExtVal$annotations(p0: java.lang.String): void public @AGet method getOverridingExtVal(@AReceiver @org.jetbrains.annotations.NotNull p0: java.lang.String): int public static @AGet method getOverridingExtVal-impl(p0: int, @AReceiver @org.jetbrains.annotations.NotNull p1: java.lang.String): int + public synthetic deprecated static @A method getOverridingExtVar$annotations(p0: java.lang.String): void public @AGet method getOverridingExtVar(@AReceiver @org.jetbrains.annotations.NotNull p0: java.lang.String): int public static @AGet method getOverridingExtVar-impl(p0: int, @AReceiver @org.jetbrains.annotations.NotNull p1: java.lang.String): int + public synthetic deprecated static @A method getOverridingVal$annotations(): void public @AGet method getOverridingVal(): int public static @AGet method getOverridingVal-impl(p0: int): int + public synthetic deprecated static @A method getOverridingVar$annotations(): void public @AGet method getOverridingVar(): int public static @AGet method getOverridingVar-impl(p0: int): int public final @AGet method getX(): int public method hashCode(): int public static method hashCode-impl(p0: int): int public final static @A method nonOverridingExtFun-impl(p0: int, @AReceiver @org.jetbrains.annotations.NotNull p1: java.lang.String): void - public synthetic deprecated static @A method nonOverridingExtVal$annotations(p0: java.lang.String): void - public synthetic deprecated static @A method nonOverridingExtVar$annotations(p0: java.lang.String): void public final static @A method nonOverridingFun-impl(p0: int): void - public synthetic deprecated static @A method nonOverridingVal$annotations(): void - public synthetic deprecated static @A method nonOverridingVar$annotations(): void public @A method overridingExtFun(@AReceiver @org.jetbrains.annotations.NotNull p0: java.lang.String): void public static @A method overridingExtFun-impl(p0: int, @AReceiver @org.jetbrains.annotations.NotNull p1: java.lang.String): void - public synthetic deprecated static @A method overridingExtVal$annotations(p0: java.lang.String): void - public synthetic deprecated static @A method overridingExtVar$annotations(p0: java.lang.String): void public @A method overridingFun(): void public static @A method overridingFun-impl(p0: int): void - public synthetic deprecated static @A method overridingVal$annotations(): void - public synthetic deprecated static @A method overridingVar$annotations(): void public final static @ASet method setNonOverridingExtVar-impl(p0: int, @AReceiver @org.jetbrains.annotations.NotNull p1: java.lang.String, @ASetParam p2: int): void public final static @ASet method setNonOverridingVar-impl(p0: int, @ASetParam p1: int): void public @ASet method setOverridingExtVar(@AReceiver @org.jetbrains.annotations.NotNull p0: java.lang.String, @ASetParam p1: int): void diff --git a/compiler/testData/codegen/bytecodeListing/multiplatform/optionalExpectation.kt b/compiler/testData/codegen/bytecodeListing/multiplatform/optionalExpectation.kt index 9014629a54a..813bef61d4d 100644 --- a/compiler/testData/codegen/bytecodeListing/multiplatform/optionalExpectation.kt +++ b/compiler/testData/codegen/bytecodeListing/multiplatform/optionalExpectation.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +MultiPlatformProjects -UseGetterNameForPropertyAnnotationsMethodOnJvm +// !LANGUAGE: +MultiPlatformProjects +UseGetterNameForPropertyAnnotationsMethodOnJvm // !USE_EXPERIMENTAL: kotlin.ExperimentalMultiplatform // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/bytecodeListing/multiplatform/optionalExpectation.txt b/compiler/testData/codegen/bytecodeListing/multiplatform/optionalExpectation.txt index a176442165d..1f4b3fb78f7 100644 --- a/compiler/testData/codegen/bytecodeListing/multiplatform/optionalExpectation.txt +++ b/compiler/testData/codegen/bytecodeListing/multiplatform/optionalExpectation.txt @@ -16,7 +16,7 @@ public final class Foo { inner class Foo$Nested public method (p0: int): void public final method bar(): void + public synthetic deprecated static method getX$annotations(): void public final method getX(): int public final method setX(p0: int): void - public synthetic deprecated static method x$annotations(): void } diff --git a/compiler/testData/writeFlags/jvm8/defaults/compatibility/propertyAnnotation.kt b/compiler/testData/writeFlags/jvm8/defaults/compatibility/propertyAnnotation.kt index b68c9469831..32fcb3fbabd 100644 --- a/compiler/testData/writeFlags/jvm8/defaults/compatibility/propertyAnnotation.kt +++ b/compiler/testData/writeFlags/jvm8/defaults/compatibility/propertyAnnotation.kt @@ -1,4 +1,5 @@ // !JVM_DEFAULT_MODE: compatibility +// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm // JVM_TARGET: 1.8 // WITH_RUNTIME @@ -12,9 +13,9 @@ interface Test { } // TESTED_OBJECT_KIND: function -// TESTED_OBJECTS: Test, test$annotations +// TESTED_OBJECTS: Test, getTest$annotations // ABSENT: TRUE // TESTED_OBJECT_KIND: function -// TESTED_OBJECTS: Test$DefaultImpls, test$annotations +// TESTED_OBJECTS: Test$DefaultImpls, getTest$annotations // FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC, ACC_DEPRECATED diff --git a/compiler/testData/writeFlags/jvm8/defaults/propertyAnnotation.kt b/compiler/testData/writeFlags/jvm8/defaults/propertyAnnotation.kt index 95ffcfba561..553c94f26f5 100644 --- a/compiler/testData/writeFlags/jvm8/defaults/propertyAnnotation.kt +++ b/compiler/testData/writeFlags/jvm8/defaults/propertyAnnotation.kt @@ -1,4 +1,5 @@ // !JVM_DEFAULT_MODE: enable +// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm // JVM_TARGET: 1.8 // WITH_RUNTIME @@ -14,9 +15,9 @@ interface Test { } // TESTED_OBJECT_KIND: function -// TESTED_OBJECTS: Test, test$annotations +// TESTED_OBJECTS: Test, getTest$annotations // ABSENT: TRUE // TESTED_OBJECT_KIND: function -// TESTED_OBJECTS: Test$DefaultImpls, test$annotations +// TESTED_OBJECTS: Test$DefaultImpls, getTest$annotations // FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC, ACC_DEPRECATED diff --git a/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/doNotUseGetterName.kt b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/doNotUseGetterName.kt new file mode 100644 index 00000000000..8f7d953d7af --- /dev/null +++ b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/doNotUseGetterName.kt @@ -0,0 +1,12 @@ +// !LANGUAGE: -UseGetterNameForPropertyAnnotationsMethodOnJvm + +class Foo { + annotation class Anno + + @Anno + val prop = 42 +} + +// TESTED_OBJECT_KIND: function +// TESTED_OBJECTS: Foo, prop$annotations +// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PUBLIC diff --git a/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt index 1fe78842019..4e1a285a452 100644 --- a/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt +++ b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt @@ -1,3 +1,5 @@ +// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm + class Foo { annotation class Anno @@ -6,5 +8,5 @@ class Foo { } // TESTED_OBJECT_KIND: function -// TESTED_OBJECTS: Foo, prop$annotations +// TESTED_OBJECTS: Foo, getProp$annotations // FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PRIVATE diff --git a/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/protectedProperty.kt b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/protectedProperty.kt index f27e76f4695..73b0dd2eee9 100644 --- a/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/protectedProperty.kt +++ b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/protectedProperty.kt @@ -1,3 +1,5 @@ +// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm + open class Foo { annotation class Anno @@ -6,5 +8,5 @@ open class Foo { } // TESTED_OBJECT_KIND: function -// TESTED_OBJECTS: Foo, prop$annotations +// TESTED_OBJECTS: Foo, getProp$annotations // FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PROTECTED diff --git a/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/publicProperty.kt b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/publicProperty.kt index 27b13f60013..711950fa200 100644 --- a/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/publicProperty.kt +++ b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/publicProperty.kt @@ -1,3 +1,5 @@ +// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm + class Foo { annotation class Anno @@ -6,5 +8,5 @@ class Foo { } // TESTED_OBJECT_KIND: function -// TESTED_OBJECTS: Foo, prop$annotations +// TESTED_OBJECTS: Foo, getProp$annotations // FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PUBLIC diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/flags/WriteFlagsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/flags/WriteFlagsTestGenerated.java index f925f0f862f..cb3505025a0 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/flags/WriteFlagsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/flags/WriteFlagsTestGenerated.java @@ -1199,6 +1199,11 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("doNotUseGetterName.kt") + public void testDoNotUseGetterName() throws Exception { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/doNotUseGetterName.kt"); + } + @TestMetadata("privateProperty.kt") public void testPrivateProperty() throws Exception { runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrWriteFlagsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrWriteFlagsTestGenerated.java index fbfc1a8abf4..633fbd5bf94 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrWriteFlagsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrWriteFlagsTestGenerated.java @@ -1199,6 +1199,11 @@ public class IrWriteFlagsTestGenerated extends AbstractIrWriteFlagsTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @TestMetadata("doNotUseGetterName.kt") + public void testDoNotUseGetterName() throws Exception { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/doNotUseGetterName.kt"); + } + @TestMetadata("privateProperty.kt") public void testPrivateProperty() throws Exception { runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt");