diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java index a069023f826..80312a36403 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java @@ -31,6 +31,7 @@ import org.jetbrains.kotlin.codegen.serialization.JvmSerializerExtension; import org.jetbrains.kotlin.codegen.state.GenerationState; import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper; import org.jetbrains.kotlin.descriptors.*; +import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget; import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl; import org.jetbrains.kotlin.fileClasses.FileClasses; @@ -237,14 +238,20 @@ public abstract class MemberCodegen(@AnnParameterProperty @AnnParameterField p0: int): void - private synthetic deprecated static @AnnProperty @AnnFieldProperty @AnnParameterProperty method a$annotations(): void + public synthetic deprecated static @AnnProperty @AnnFieldProperty @AnnParameterProperty method a$annotations(): void public final method getA(): int public final method getX(): int - private synthetic deprecated static @AnnProperty @AnnFieldProperty method x$annotations(): void + public synthetic deprecated static @AnnProperty @AnnFieldProperty method x$annotations(): void } @kotlin.annotation.Target @@ -56,4 +56,4 @@ public final class DefaultTargetsKt { private final static @Anno field p2: int static method (): void public final static method getP2(): int -} \ 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 214faf2a1ae..72c49284d3d 100644 --- a/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt +++ b/compiler/testData/codegen/bytecodeListing/annotations/onProperties.txt @@ -11,11 +11,11 @@ public final class A { public final @org.jetbrains.annotations.NotNull method getS(): java.lang.String public final method getX(): int public final @AnnGetter method getY(): int - private synthetic deprecated static @AnnProp @AnnProp2 method p$annotations(): void - private synthetic deprecated static @AnnProp @AnnProp2 @AnnDelegate method s$annotations(): void + 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 - private synthetic deprecated static @AnnProp2 method x$annotations(): void + public synthetic deprecated static @AnnProp2 method x$annotations(): void } @java.lang.annotation.Retention @@ -50,4 +50,4 @@ public annotation class AnnSetter public final class CustomDelegate { public method (): void public final @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.reflect.KProperty): java.lang.String -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/bytecodeListing/inlineOnlyProperty.txt b/compiler/testData/codegen/bytecodeListing/inlineOnlyProperty.txt index 2323e6e4e84..ef353da9bca 100644 --- a/compiler/testData/codegen/bytecodeListing/inlineOnlyProperty.txt +++ b/compiler/testData/codegen/bytecodeListing/inlineOnlyProperty.txt @@ -4,7 +4,7 @@ public final class Foo { private final method getExtProp(p0: java.lang.Object): java.lang.String private final method getProp(): java.lang.String private final @kotlin.internal.InlineOnly method getProp2(): java.lang.String - private synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void + 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 } @@ -14,7 +14,7 @@ public final class InlineOnlyPropertyKt { private final static method getExtProp(p0: java.lang.Object): java.lang.String private final static method getProp(): java.lang.String private final static @kotlin.internal.InlineOnly method getProp2(): java.lang.String - private synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void + 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/light-analysis/annotations/annotationsOnTypeAliases.txt b/compiler/testData/codegen/light-analysis/annotations/annotationsOnTypeAliases.txt index 0bba731bbb3..a5d6857126d 100644 --- a/compiler/testData/codegen/light-analysis/annotations/annotationsOnTypeAliases.txt +++ b/compiler/testData/codegen/light-analysis/annotations/annotationsOnTypeAliases.txt @@ -9,7 +9,7 @@ public annotation class Ann { @kotlin.Metadata public final class AnnotationsOnTypeAliasesKt { - private synthetic deprecated static @Ann method TA$annotations(): void + public synthetic deprecated static @Ann method TA$annotations(): void public final static method assertHasDeclaredMethodWithAnn(@org.jetbrains.annotations.NotNull p0: java.lang.Class): void public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String } diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/jvmStaticInObject.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/jvmStaticInObject.txt index 0996c21d684..c0acdf225bc 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/jvmStaticInObject.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/jvmStaticInObject.txt @@ -21,7 +21,7 @@ public final class Test { public final static @org.jetbrains.annotations.NotNull method getTestK(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getTestO(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getTestOK(): java.lang.String - private synthetic deprecated static @kotlin.jvm.JvmStatic method testK$annotations(): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method testO$annotations(): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method testOK$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method testK$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method testO$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method testOK$annotations(): void } diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/closure.txt b/compiler/testData/codegen/light-analysis/jvmStatic/closure.txt index 71d3c5235ae..d2d98028a35 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/closure.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/closure.txt @@ -4,7 +4,7 @@ public final class A { private final static @org.jetbrains.annotations.NotNull field b: java.lang.String private final static @org.jetbrains.annotations.NotNull field c: java.lang.String private method (): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void public final @org.jetbrains.annotations.NotNull method getB(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getC(): java.lang.String public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method test1(): java.lang.String diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/companionObject.txt b/compiler/testData/codegen/light-analysis/jvmStatic/companionObject.txt index 56856dd0bb4..b5a2681419c 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/companionObject.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/companionObject.txt @@ -15,7 +15,7 @@ public final class A { public final static class A/Companion { inner class A/Companion private method (): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void public final @org.jetbrains.annotations.NotNull method getB(): java.lang.String public final @org.jetbrains.annotations.NotNull method getC(): java.lang.String public final @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method test1(): java.lang.String diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/enumCompanion.txt b/compiler/testData/codegen/light-analysis/jvmStatic/enumCompanion.txt index 7bf4d95c57f..3fe9a5847aa 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/enumCompanion.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/enumCompanion.txt @@ -16,7 +16,7 @@ public enum class A { public final static class A/Companion { inner class A/Companion private method (): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method bar$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method bar$annotations(): void public final @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method baz(): java.lang.String public final @org.jetbrains.annotations.NotNull method getBar(): java.lang.String } diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/explicitObject.txt b/compiler/testData/codegen/light-analysis/jvmStatic/explicitObject.txt index 10b25578bcd..a69507a1f9a 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/explicitObject.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/explicitObject.txt @@ -6,7 +6,7 @@ public final class AX { public final @org.jetbrains.annotations.NotNull method aNonStatic(): java.lang.String public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method aStatic(): java.lang.String public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method b(): java.lang.String - private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void public final static @org.jetbrains.annotations.NotNull method getC(): java.lang.String public final @org.jetbrains.annotations.NotNull method getProperty(): java.lang.String } diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/importStaticMemberFromObject.txt b/compiler/testData/codegen/light-analysis/jvmStatic/importStaticMemberFromObject.txt index 004e918fd2a..8215afff77b 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/importStaticMemberFromObject.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/importStaticMemberFromObject.txt @@ -14,7 +14,7 @@ public final static class C/Companion { private method (): void public final @kotlin.jvm.JvmStatic method f1(): int public final method getP1(): int - private synthetic deprecated static @kotlin.jvm.JvmStatic method p1$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method p1$annotations(): void } @kotlin.Metadata @@ -29,5 +29,5 @@ public final class O { private method (): void public final static @kotlin.jvm.JvmStatic method f(): int public final static method getP(): int - private synthetic deprecated static @kotlin.jvm.JvmStatic method p$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method p$annotations(): void } diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/kt9897_static.txt b/compiler/testData/codegen/light-analysis/jvmStatic/kt9897_static.txt index e90b9c738b0..6a59be27963 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/kt9897_static.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/kt9897_static.txt @@ -19,6 +19,6 @@ public final class Test { public final static method setSomeProperty(@org.jetbrains.annotations.NotNull p0: java.lang.String, p1: int): void public final static method setSomeProperty(p0: long, p1: long): void public final method setZ(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method someProperty$annotations(p0: java.lang.String): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method someProperty$annotations(p0: long): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method someProperty$annotations(p0: java.lang.String): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method someProperty$annotations(p0: long): void } diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/object.txt b/compiler/testData/codegen/light-analysis/jvmStatic/object.txt index d1dd89aaa77..3c6e45edc07 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/object.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/object.txt @@ -4,7 +4,7 @@ public final class A { private final static @org.jetbrains.annotations.NotNull field b: java.lang.String private final static @org.jetbrains.annotations.NotNull field c: java.lang.String private method (): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void public final @org.jetbrains.annotations.NotNull method getB(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getC(): java.lang.String public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method test1(): java.lang.String diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/postfixInc.txt b/compiler/testData/codegen/light-analysis/jvmStatic/postfixInc.txt index 7f989e3eddb..5db368d5925 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/postfixInc.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/postfixInc.txt @@ -5,7 +5,7 @@ public final class A { private static field b: int private static field c: int private method (): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void public final static method getA(): int public final static @kotlin.jvm.JvmStatic method getB(): int public final method getC(): int diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/prefixInc.txt b/compiler/testData/codegen/light-analysis/jvmStatic/prefixInc.txt index 4f94671b557..b127afaf52e 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/prefixInc.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/prefixInc.txt @@ -5,7 +5,7 @@ public final class A { private static field b: int private static field c: int private method (): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void public final static method getA(): int public final static @kotlin.jvm.JvmStatic method getB(): int public final method getC(): int diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/privateSetter.txt b/compiler/testData/codegen/light-analysis/jvmStatic/privateSetter.txt index 7894925d5c6..2261d01ac70 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/privateSetter.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/privateSetter.txt @@ -21,5 +21,5 @@ public final static class TestApp/Companion { public synthetic final static method access$setValue$p(p0: TestApp.Companion, @org.jetbrains.annotations.NotNull p1: java.lang.String): void public final @org.jetbrains.annotations.NotNull method getValue(): java.lang.String private final method setValue(p0: java.lang.String): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method value$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method value$annotations(): void } diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/propertyAccess.txt b/compiler/testData/codegen/light-analysis/jvmStatic/propertyAccess.txt index 08211117fa2..411b278cd11 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/propertyAccess.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/propertyAccess.txt @@ -5,7 +5,7 @@ public final class A { private static field b: int private static field c: int private method (): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void public final static method getA(): int public final static @kotlin.jvm.JvmStatic method getB(): int public final method getC(): int diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/propertyAsDefault.txt b/compiler/testData/codegen/light-analysis/jvmStatic/propertyAsDefault.txt index 7872c5c8405..3001e29e233 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/propertyAsDefault.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/propertyAsDefault.txt @@ -11,5 +11,5 @@ public final class X { public synthetic static method fn$default(p0: X, p1: java.lang.String, p2: int, p3: java.lang.Object): java.lang.String public final @org.jetbrains.annotations.NotNull method fn(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String public final static @org.jetbrains.annotations.NotNull method getX(): java.lang.String - private synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void } diff --git a/compiler/testData/codegen/light-analysis/jvmStatic/simple.txt b/compiler/testData/codegen/light-analysis/jvmStatic/simple.txt index 940fe1505c0..fc1af258106 100644 --- a/compiler/testData/codegen/light-analysis/jvmStatic/simple.txt +++ b/compiler/testData/codegen/light-analysis/jvmStatic/simple.txt @@ -4,7 +4,7 @@ public final class A { private final static @org.jetbrains.annotations.NotNull field b: java.lang.String private final static @org.jetbrains.annotations.NotNull field c: java.lang.String private method (): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void public final @org.jetbrains.annotations.NotNull method getB(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getC(): java.lang.String public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method test1(): java.lang.String diff --git a/compiler/testData/codegen/light-analysis/multifileClasses/constPropertyReferenceFromMultifileClass.txt b/compiler/testData/codegen/light-analysis/multifileClasses/constPropertyReferenceFromMultifileClass.txt index 4c607bab5d2..081244c2195 100644 --- a/compiler/testData/codegen/light-analysis/multifileClasses/constPropertyReferenceFromMultifileClass.txt +++ b/compiler/testData/codegen/light-analysis/multifileClasses/constPropertyReferenceFromMultifileClass.txt @@ -10,7 +10,7 @@ public annotation class a/A @kotlin.Metadata public final class a/MultifileClass { public final static @org.jetbrains.annotations.NotNull field OK: java.lang.String - private synthetic deprecated static @a.A method OK$annotations(): void + public synthetic deprecated static @a.A method OK$annotations(): void } @kotlin.Metadata diff --git a/compiler/testData/codegen/light-analysis/properties/twoAnnotatedExtensionPropertiesWithoutBackingFields.txt b/compiler/testData/codegen/light-analysis/properties/twoAnnotatedExtensionPropertiesWithoutBackingFields.txt index 952a5f0b85b..da51d43c6ef 100644 --- a/compiler/testData/codegen/light-analysis/properties/twoAnnotatedExtensionPropertiesWithoutBackingFields.txt +++ b/compiler/testData/codegen/light-analysis/properties/twoAnnotatedExtensionPropertiesWithoutBackingFields.txt @@ -5,8 +5,8 @@ public annotation class Anno @kotlin.Metadata public final class TwoAnnotatedExtensionPropertiesWithoutBackingFieldsKt { public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String - private synthetic deprecated static @Anno method foo$annotations(p0: int): void - private synthetic deprecated static @Anno method foo$annotations(p0: java.lang.String): void + public synthetic deprecated static @Anno method foo$annotations(p0: int): void + public synthetic deprecated static @Anno method foo$annotations(p0: java.lang.String): void public final static method getFoo(@org.jetbrains.annotations.NotNull p0: java.lang.String): int public final static method getFoo(p0: int): int } diff --git a/compiler/testData/codegen/light-analysis/reflection/annotations/propertyWithoutBackingField.txt b/compiler/testData/codegen/light-analysis/reflection/annotations/propertyWithoutBackingField.txt index b4a471de915..8c5eeb4b7ea 100644 --- a/compiler/testData/codegen/light-analysis/reflection/annotations/propertyWithoutBackingField.txt +++ b/compiler/testData/codegen/light-analysis/reflection/annotations/propertyWithoutBackingField.txt @@ -8,5 +8,5 @@ public annotation class Ann { public final class PropertyWithoutBackingFieldKt { public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getProperty(): java.lang.String - private synthetic deprecated static @Ann method property$annotations(): void + public synthetic deprecated static @Ann method property$annotations(): void } diff --git a/compiler/testData/codegen/light-analysis/reflection/annotations/simpleValAnnotation.txt b/compiler/testData/codegen/light-analysis/reflection/annotations/simpleValAnnotation.txt index 510284e707c..3dafa69d7b5 100644 --- a/compiler/testData/codegen/light-analysis/reflection/annotations/simpleValAnnotation.txt +++ b/compiler/testData/codegen/light-analysis/reflection/annotations/simpleValAnnotation.txt @@ -9,6 +9,6 @@ public annotation class Simple { public final class SimpleValAnnotationKt { private final static field foo: int public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String - private synthetic deprecated static @Simple method foo$annotations(): void + public synthetic deprecated static @Simple method foo$annotations(): void public final static method getFoo(): int } diff --git a/compiler/testData/codegen/light-analysis/reflection/call/bound/jvmStaticCompanionObjectPropertyAccessors.txt b/compiler/testData/codegen/light-analysis/reflection/call/bound/jvmStaticCompanionObjectPropertyAccessors.txt index ca89847b267..9fc317fc655 100644 --- a/compiler/testData/codegen/light-analysis/reflection/call/bound/jvmStaticCompanionObjectPropertyAccessors.txt +++ b/compiler/testData/codegen/light-analysis/reflection/call/bound/jvmStaticCompanionObjectPropertyAccessors.txt @@ -23,10 +23,10 @@ public final static class Host/Companion { public final method getYy(): int public final method setY(p0: int): void public final method setYy(p0: int): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method xx$annotations(): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method y$annotations(): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method yy$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method xx$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method y$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method yy$annotations(): void } @kotlin.Metadata diff --git a/compiler/testData/codegen/light-analysis/reflection/call/bound/jvmStaticObjectPropertyAccessors.txt b/compiler/testData/codegen/light-analysis/reflection/call/bound/jvmStaticObjectPropertyAccessors.txt index 50afdde3948..d7fcb4298be 100644 --- a/compiler/testData/codegen/light-analysis/reflection/call/bound/jvmStaticObjectPropertyAccessors.txt +++ b/compiler/testData/codegen/light-analysis/reflection/call/bound/jvmStaticObjectPropertyAccessors.txt @@ -10,10 +10,10 @@ public final class Host { public final static method getYy(): int public final static method setY(p0: int): void public final static method setYy(p0: int): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method xx$annotations(): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method y$annotations(): void - private synthetic deprecated static @kotlin.jvm.JvmStatic method yy$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method xx$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method y$annotations(): void + public synthetic deprecated static @kotlin.jvm.JvmStatic method yy$annotations(): void } @kotlin.Metadata diff --git a/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt new file mode 100644 index 00000000000..1fe78842019 --- /dev/null +++ b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt @@ -0,0 +1,10 @@ +class Foo { + annotation class Anno + + @Anno + private val prop = 42 +} + +// TESTED_OBJECT_KIND: function +// TESTED_OBJECTS: Foo, prop$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 new file mode 100644 index 00000000000..f27e76f4695 --- /dev/null +++ b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/protectedProperty.kt @@ -0,0 +1,10 @@ +open class Foo { + annotation class Anno + + @Anno + protected val prop = 42 +} + +// TESTED_OBJECT_KIND: function +// TESTED_OBJECTS: Foo, prop$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 new file mode 100644 index 00000000000..27b13f60013 --- /dev/null +++ b/compiler/testData/writeFlags/property/syntheticAnnotationsMethod/publicProperty.kt @@ -0,0 +1,10 @@ +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/typealias/syntheticAnnotationsMethod/privateTypealias.kt b/compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/privateTypealias.kt new file mode 100644 index 00000000000..7bb3b0f1d43 --- /dev/null +++ b/compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/privateTypealias.kt @@ -0,0 +1,9 @@ +@Target(AnnotationTarget.TYPEALIAS) +annotation class Anno + +@Anno +private typealias Foo = String + +// TESTED_OBJECT_KIND: function +// TESTED_OBJECTS: PrivateTypealiasKt, Foo$annotations +// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PRIVATE diff --git a/compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/publicTypealias.kt b/compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/publicTypealias.kt new file mode 100644 index 00000000000..ea8d960a48f --- /dev/null +++ b/compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/publicTypealias.kt @@ -0,0 +1,9 @@ +@Target(AnnotationTarget.TYPEALIAS) +annotation class Anno + +@Anno +typealias Foo = String + +// TESTED_OBJECT_KIND: function +// TESTED_OBJECTS: PublicTypealiasKt, Foo$annotations +// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PUBLIC diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/SyntheticMethodForAnnotatedPropertyGenTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/SyntheticMethodForAnnotatedPropertyGenTest.java index 4cdb6f74f80..8d75a43f470 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/SyntheticMethodForAnnotatedPropertyGenTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/SyntheticMethodForAnnotatedPropertyGenTest.java @@ -67,7 +67,7 @@ public class SyntheticMethodForAnnotatedPropertyGenTest extends CodegenTestCase assertTrue(method.isSynthetic()); int modifiers = method.getModifiers(); assertTrue(Modifier.isStatic(modifiers)); - assertTrue(Modifier.isPrivate(modifiers)); + assertTrue(Modifier.isPublic(modifiers)); Annotation[] annotations = method.getDeclaredAnnotations(); assertSize(1, annotations); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/flags/WriteFlagsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/flags/WriteFlagsTestGenerated.java index d5c6cafae6c..55d9fcb7af0 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/flags/WriteFlagsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/flags/WriteFlagsTestGenerated.java @@ -1022,6 +1022,33 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest { } } + @TestMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SyntheticAnnotationsMethod extends AbstractWriteFlagsTest { + public void testAllFilesPresentInSyntheticAnnotationsMethod() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/property/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("privateProperty.kt") + public void testPrivateProperty() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt"); + doTest(fileName); + } + + @TestMetadata("protectedProperty.kt") + public void testProtectedProperty() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/protectedProperty.kt"); + doTest(fileName); + } + + @TestMetadata("publicProperty.kt") + public void testPublicProperty() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/publicProperty.kt"); + doTest(fileName); + } + } + @TestMetadata("compiler/testData/writeFlags/property/visibility") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -1049,4 +1076,34 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest { } } } + + @TestMetadata("compiler/testData/writeFlags/typealias") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Typealias extends AbstractWriteFlagsTest { + public void testAllFilesPresentInTypealias() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/typealias"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SyntheticAnnotationsMethod extends AbstractWriteFlagsTest { + public void testAllFilesPresentInSyntheticAnnotationsMethod() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("privateTypealias.kt") + public void testPrivateTypealias() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/privateTypealias.kt"); + doTest(fileName); + } + + @TestMetadata("publicTypealias.kt") + public void testPublicTypealias() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/publicTypealias.kt"); + doTest(fileName); + } + } + } }