Use JVM name of getter in synthetic method for property annotations
#KT-31352 In Progress
This commit is contained in:
@@ -1157,7 +1157,7 @@ class KotlinTypeMapper @JvmOverloads constructor(
|
|||||||
|
|
||||||
fun mapSyntheticMethodForPropertyAnnotations(descriptor: PropertyDescriptor): Method {
|
fun mapSyntheticMethodForPropertyAnnotations(descriptor: PropertyDescriptor): Method {
|
||||||
val receiver = descriptor.extensionReceiverParameter
|
val receiver = descriptor.extensionReceiverParameter
|
||||||
val name = JvmAbi.getSyntheticMethodNameForAnnotatedProperty(descriptor.name)
|
val name = JvmAbi.getSyntheticMethodNameForAnnotatedProperty(mapFunctionName(descriptor.getter!!, OwnerKind.IMPLEMENTATION))
|
||||||
val desc = if (receiver == null) "()V" else "(${mapType(receiver.type)})V"
|
val desc = if (receiver == null) "()V" else "(${mapType(receiver.type)})V"
|
||||||
return Method(name, desc)
|
return Method(name, desc)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -31,7 +31,7 @@ class PropertiesLowering(
|
|||||||
private val originOfSyntheticMethodForAnnotations: IrDeclarationOrigin? = null,
|
private val originOfSyntheticMethodForAnnotations: IrDeclarationOrigin? = null,
|
||||||
private val skipExternalProperties: Boolean = false,
|
private val skipExternalProperties: Boolean = false,
|
||||||
private val generateAnnotationFields: Boolean = false,
|
private val generateAnnotationFields: Boolean = false,
|
||||||
private val computeSyntheticMethodName: ((Name) -> String)? = null
|
private val computeSyntheticMethodName: ((IrProperty) -> String)? = null
|
||||||
) : IrElementTransformerVoid(), FileLoweringPass {
|
) : IrElementTransformerVoid(), FileLoweringPass {
|
||||||
override fun lower(irFile: IrFile) {
|
override fun lower(irFile: IrFile) {
|
||||||
irFile.accept(this, null)
|
irFile.accept(this, null)
|
||||||
@@ -63,7 +63,7 @@ class PropertiesLowering(
|
|||||||
if (declaration.annotations.isNotEmpty() && originOfSyntheticMethodForAnnotations != null
|
if (declaration.annotations.isNotEmpty() && originOfSyntheticMethodForAnnotations != null
|
||||||
&& computeSyntheticMethodName != null
|
&& computeSyntheticMethodName != null
|
||||||
) {
|
) {
|
||||||
val methodName = computeSyntheticMethodName.invoke(declaration.name) // Workaround KT-4113
|
val methodName = computeSyntheticMethodName.invoke(declaration) // Workaround KT-4113
|
||||||
add(createSyntheticMethodForAnnotations(declaration, originOfSyntheticMethodForAnnotations, methodName))
|
add(createSyntheticMethodForAnnotations(declaration, originOfSyntheticMethodForAnnotations, methodName))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.backend.common.lower.*
|
|||||||
import org.jetbrains.kotlin.backend.common.lower.loops.forLoopsPhase
|
import org.jetbrains.kotlin.backend.common.lower.loops.forLoopsPhase
|
||||||
import org.jetbrains.kotlin.backend.common.phaser.*
|
import org.jetbrains.kotlin.backend.common.phaser.*
|
||||||
import org.jetbrains.kotlin.backend.jvm.lower.*
|
import org.jetbrains.kotlin.backend.jvm.lower.*
|
||||||
|
import org.jetbrains.kotlin.codegen.OwnerKind
|
||||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationWithName
|
import org.jetbrains.kotlin.ir.declarations.IrDeclarationWithName
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||||
@@ -67,10 +68,13 @@ private val lateinitPhase = makeIrFilePhase(
|
|||||||
description = "Insert checks for lateinit field references"
|
description = "Insert checks for lateinit field references"
|
||||||
)
|
)
|
||||||
|
|
||||||
private val propertiesPhase = makeIrFilePhase<CommonBackendContext>(
|
private val propertiesPhase = makeIrFilePhase<JvmBackendContext>(
|
||||||
{ context ->
|
{ context ->
|
||||||
PropertiesLowering(context, JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_ANNOTATIONS) { propertyName ->
|
PropertiesLowering(context, JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_ANNOTATIONS) { property ->
|
||||||
JvmAbi.getSyntheticMethodNameForAnnotatedProperty(propertyName)
|
val getterName = property.getter?.let { getter ->
|
||||||
|
context.typeMapper.mapFunctionName(getter, OwnerKind.IMPLEMENTATION)
|
||||||
|
} ?: JvmAbi.getterName(property.name.asString())
|
||||||
|
JvmAbi.getSyntheticMethodNameForAnnotatedProperty(getterName)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
name = "Properties",
|
name = "Properties",
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
// TARGET_BACKEND: JVM
|
||||||
|
// WITH_REFLECT
|
||||||
|
|
||||||
|
import kotlin.reflect.KProperty2
|
||||||
|
|
||||||
|
class C {
|
||||||
|
@Deprecated("int")
|
||||||
|
@get:JvmName("mapIntIntHex")
|
||||||
|
val Map<Int, Int>.hex: String get() = "O"
|
||||||
|
|
||||||
|
@Deprecated("byte")
|
||||||
|
@get:JvmName("mapIntByteHex")
|
||||||
|
val Map<Int, Byte>.hex: String get() = "K"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val a1 = C::class.members.single {
|
||||||
|
it is KProperty2<*, *, *> && it.parameters[1].type.arguments[1].type!!.classifier == Int::class
|
||||||
|
}.annotations
|
||||||
|
if ((a1.single() as Deprecated).message != "int")
|
||||||
|
return "Fail annotations on Map<Int, Int>::hex: $a1"
|
||||||
|
|
||||||
|
val a2 = C::class.members.single {
|
||||||
|
it is KProperty2<*, *, *> && it.parameters[1].type.arguments[1].type!!.classifier == Byte::class
|
||||||
|
}.annotations
|
||||||
|
if ((a2.single() as Deprecated).message != "byte")
|
||||||
|
return "Fail annotations on Map<Int, Byte>::hex: $a2"
|
||||||
|
|
||||||
|
return with(C()) { mapOf(0 to 0).hex + mapOf(0 to 0.toByte()).hex }
|
||||||
|
}
|
||||||
@@ -3,10 +3,10 @@ public final class A {
|
|||||||
private final @AnnField @AnnParameterField @AnnTypeField field a: int
|
private final @AnnField @AnnParameterField @AnnTypeField field a: int
|
||||||
private final @AnnField @AnnTypeField field x: int
|
private final @AnnField @AnnTypeField field x: int
|
||||||
public method <init>(@AnnParameterProperty @AnnParameterField p0: int): void
|
public method <init>(@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 final method getA(): int
|
||||||
|
public synthetic deprecated static @AnnProperty @AnnFieldProperty method getX$annotations(): void
|
||||||
public final method getX(): int
|
public final method getX(): int
|
||||||
public synthetic deprecated static @AnnProperty @AnnFieldProperty method x$annotations(): void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.annotation.Target
|
@kotlin.annotation.Target
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ public final class A {
|
|||||||
private field y: int
|
private field y: int
|
||||||
static method <clinit>(): void
|
static method <clinit>(): void
|
||||||
public method <init>(@AnnParam p0: int, @AnnParam p1: int): void
|
public method <init>(@AnnParam p0: int, @AnnParam p1: int): void
|
||||||
|
public synthetic deprecated static @AnnProp @AnnProp2 method getP$annotations(): void
|
||||||
public final @AnnGetter method getP(): int
|
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 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 method getX(): int
|
||||||
public final @AnnGetter method getY(): 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 setP(@AnnParam p0: int): void
|
||||||
public final @AnnSetter method setY(p0: int): void
|
public final @AnnSetter method setY(p0: int): void
|
||||||
public synthetic deprecated static @AnnProp2 method x$annotations(): void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@java.lang.annotation.Retention
|
@java.lang.annotation.Retention
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ public final class test/Foo {
|
|||||||
@kotlin.Metadata
|
@kotlin.Metadata
|
||||||
synthetic final class test/Foo__InlineOnlyPropertyMultifileKt {
|
synthetic final class test/Foo__InlineOnlyPropertyMultifileKt {
|
||||||
public final static method foo(): void
|
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
|
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
|
private final static method setProp(p0: java.lang.String): void
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
@kotlin.Metadata
|
@kotlin.Metadata
|
||||||
public final class Foo {
|
public final class Foo {
|
||||||
public method <init>(): void
|
public method <init>(): void
|
||||||
|
public synthetic deprecated static @kotlin.internal.InlineOnly method getProp$annotations(): void
|
||||||
private final method getProp(): java.lang.String
|
private final method getProp(): java.lang.String
|
||||||
private final @kotlin.internal.InlineOnly method getProp2(): 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
|
private final method setProp(p0: java.lang.String): void
|
||||||
public final method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
public final method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.Metadata
|
@kotlin.Metadata
|
||||||
public final class InlineOnlyPropertyKt {
|
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 method getProp(): java.lang.String
|
||||||
private final static @kotlin.internal.InlineOnly method getProp2(): 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
|
private final static method setProp(p0: java.lang.String): void
|
||||||
public final static method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
public final static method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+8
-8
@@ -55,35 +55,35 @@ public final class Z {
|
|||||||
public method equals(p0: java.lang.Object): boolean
|
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 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 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 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 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 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 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 @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 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 @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 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 @AGet method getOverridingVal(): int
|
||||||
public static @AGet method getOverridingVal-impl(p0: int): 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 @AGet method getOverridingVar(): int
|
||||||
public static @AGet method getOverridingVar-impl(p0: int): int
|
public static @AGet method getOverridingVar-impl(p0: int): int
|
||||||
public final @AGet method getX(): int
|
public final @AGet method getX(): int
|
||||||
public method hashCode(): int
|
public method hashCode(): int
|
||||||
public static method hashCode-impl(p0: int): 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 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 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 @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 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 @A method overridingFun(): void
|
||||||
public static @A method overridingFun-impl(p0: int): 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 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 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
|
public @ASet method setOverridingExtVar(@AReceiver @org.jetbrains.annotations.NotNull p0: java.lang.String, @ASetParam p1: int): void
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ public final class Foo {
|
|||||||
inner class Foo$Nested
|
inner class Foo$Nested
|
||||||
public method <init>(p0: int): void
|
public method <init>(p0: int): void
|
||||||
public final method bar(): void
|
public final method bar(): void
|
||||||
|
public synthetic deprecated static method getX$annotations(): void
|
||||||
public final method getX(): int
|
public final method getX(): int
|
||||||
public final method setX(p0: int): void
|
public final method setX(p0: int): void
|
||||||
public synthetic deprecated static method x$annotations(): void
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3,8 +3,8 @@ public final class test/TopLevel$Companion {
|
|||||||
inner class test/TopLevel$Companion
|
inner class test/TopLevel$Companion
|
||||||
private method <init>(): void
|
private method <init>(): void
|
||||||
public final method a(): void
|
public final method a(): void
|
||||||
|
public synthetic deprecated static @kotlin.jvm.JvmStatic method getQ$annotations(): void
|
||||||
public final @org.jetbrains.annotations.NotNull method getQ(): java.lang.String
|
public final @org.jetbrains.annotations.NotNull method getQ(): java.lang.String
|
||||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method q$annotations(): void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@kotlin.Metadata
|
@kotlin.Metadata
|
||||||
|
|||||||
+2
-2
@@ -13,9 +13,9 @@ interface Test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TESTED_OBJECT_KIND: function
|
// TESTED_OBJECT_KIND: function
|
||||||
// TESTED_OBJECTS: Test, test$annotations
|
// TESTED_OBJECTS: Test, getTest$annotations
|
||||||
// ABSENT: TRUE
|
// ABSENT: TRUE
|
||||||
|
|
||||||
// TESTED_OBJECT_KIND: function
|
// 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
|
// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC, ACC_DEPRECATED
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ interface Test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TESTED_OBJECT_KIND: function
|
// TESTED_OBJECT_KIND: function
|
||||||
// TESTED_OBJECTS: Test, test$annotations
|
// TESTED_OBJECTS: Test, getTest$annotations
|
||||||
// ABSENT: TRUE
|
// ABSENT: TRUE
|
||||||
|
|
||||||
// TESTED_OBJECT_KIND: function
|
// 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
|
// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC, ACC_DEPRECATED
|
||||||
|
|||||||
+1
-1
@@ -7,5 +7,5 @@ class Foo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TESTED_OBJECT_KIND: function
|
// TESTED_OBJECT_KIND: function
|
||||||
// TESTED_OBJECTS: Foo, prop$annotations
|
// TESTED_OBJECTS: Foo, getProp$annotations
|
||||||
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PRIVATE
|
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PRIVATE
|
||||||
|
|||||||
+1
-1
@@ -7,5 +7,5 @@ open class Foo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TESTED_OBJECT_KIND: function
|
// TESTED_OBJECT_KIND: function
|
||||||
// TESTED_OBJECTS: Foo, prop$annotations
|
// TESTED_OBJECTS: Foo, getProp$annotations
|
||||||
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PROTECTED
|
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PROTECTED
|
||||||
|
|||||||
+1
-1
@@ -7,5 +7,5 @@ class Foo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TESTED_OBJECT_KIND: function
|
// TESTED_OBJECT_KIND: function
|
||||||
// TESTED_OBJECTS: Foo, prop$annotations
|
// TESTED_OBJECTS: Foo, getProp$annotations
|
||||||
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PUBLIC
|
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PUBLIC
|
||||||
|
|||||||
+5
@@ -14873,6 +14873,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/jvmName/propertyName.kt");
|
runTest("compiler/testData/codegen/box/jvmName/propertyName.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertySyntheticMethod.kt")
|
||||||
|
public void testPropertySyntheticMethod() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/jvmName/propertySyntheticMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("renamedFileClass.kt")
|
@TestMetadata("renamedFileClass.kt")
|
||||||
public void testRenamedFileClass() throws Exception {
|
public void testRenamedFileClass() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/jvmName/renamedFileClass.kt");
|
runTest("compiler/testData/codegen/box/jvmName/renamedFileClass.kt");
|
||||||
|
|||||||
+5
@@ -14873,6 +14873,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/jvmName/propertyName.kt");
|
runTest("compiler/testData/codegen/box/jvmName/propertyName.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertySyntheticMethod.kt")
|
||||||
|
public void testPropertySyntheticMethod() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/jvmName/propertySyntheticMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("renamedFileClass.kt")
|
@TestMetadata("renamedFileClass.kt")
|
||||||
public void testRenamedFileClass() throws Exception {
|
public void testRenamedFileClass() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/jvmName/renamedFileClass.kt");
|
runTest("compiler/testData/codegen/box/jvmName/renamedFileClass.kt");
|
||||||
|
|||||||
+1
-2
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.codegen;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||||
import org.jetbrains.kotlin.name.Name;
|
|
||||||
import org.jetbrains.kotlin.test.ConfigurationKind;
|
import org.jetbrains.kotlin.test.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
@@ -38,7 +37,7 @@ public class SyntheticMethodForAnnotatedPropertyGenTest extends CodegenTestCase
|
|||||||
return "properties/syntheticMethod";
|
return "properties/syntheticMethod";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String TEST_SYNTHETIC_METHOD_NAME = JvmAbi.getSyntheticMethodNameForAnnotatedProperty(Name.identifier("property"));
|
private static final String TEST_SYNTHETIC_METHOD_NAME = JvmAbi.getSyntheticMethodNameForAnnotatedProperty("getProperty");
|
||||||
|
|
||||||
public void testInClass() {
|
public void testInClass() {
|
||||||
loadFile();
|
loadFile();
|
||||||
|
|||||||
+5
@@ -13758,6 +13758,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/jvmName/propertyName.kt");
|
runTest("compiler/testData/codegen/box/jvmName/propertyName.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("propertySyntheticMethod.kt")
|
||||||
|
public void testPropertySyntheticMethod() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/jvmName/propertySyntheticMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("renamedFileClass.kt")
|
@TestMetadata("renamedFileClass.kt")
|
||||||
public void testRenamedFileClass() throws Exception {
|
public void testRenamedFileClass() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/jvmName/renamedFileClass.kt");
|
runTest("compiler/testData/codegen/box/jvmName/renamedFileClass.kt");
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ public final class JvmAbi {
|
|||||||
public static final String IMPL_SUFFIX_FOR_INLINE_CLASS_MEMBERS = "-impl";
|
public static final String IMPL_SUFFIX_FOR_INLINE_CLASS_MEMBERS = "-impl";
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static String getSyntheticMethodNameForAnnotatedProperty(@NotNull Name propertyName) {
|
public static String getSyntheticMethodNameForAnnotatedProperty(@NotNull String getterName) {
|
||||||
return propertyName.asString() + ANNOTATED_PROPERTY_METHOD_NAME_SUFFIX;
|
return getterName + ANNOTATED_PROPERTY_METHOD_NAME_SUFFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ class JvmMetadataVersion(versionArray: IntArray, val isStrictSemantics: Boolean)
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmField
|
@JvmField
|
||||||
val INSTANCE = JvmMetadataVersion(1, 1, 15)
|
val INSTANCE = JvmMetadataVersion(1, 1, 16)
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
val INVALID_VERSION = JvmMetadataVersion()
|
val INVALID_VERSION = JvmMetadataVersion()
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ package {
|
|||||||
// requires language version 1.3.0 (level=ERROR, message="property must not be used!")
|
// requires language version 1.3.0 (level=ERROR, message="property must not be used!")
|
||||||
// field: property:Ljava/lang/String;
|
// field: property:Ljava/lang/String;
|
||||||
// getter: getProperty()Ljava/lang/String;
|
// getter: getProperty()Ljava/lang/String;
|
||||||
// synthetic method for annotations: property$annotations()V
|
// synthetic method for annotations: getProperty$annotations()V
|
||||||
public final val property: kotlin/String /* = ... */
|
public final val property: kotlin/String /* = ... */
|
||||||
public final get
|
public final get
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public final class TestAnno2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Anno3(value = "property")
|
@Anno3(value = "property")
|
||||||
public static void b$annotations() {
|
public static void getB$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public final class AnnotationsTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Anno(value = "top-level-val")
|
@Anno(value = "top-level-val")
|
||||||
public static void topLevelVal$annotations(int p0) {
|
public static void getTopLevelVal$annotations(int p0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
@@ -82,14 +82,14 @@ public abstract class Test {
|
|||||||
public abstract java.lang.String abstractMethod();
|
public abstract java.lang.String abstractMethod();
|
||||||
|
|
||||||
@Anno(value = "abstract-val")
|
@Anno(value = "abstract-val")
|
||||||
public static void abstractVal$annotations() {
|
public static void getAbstractVal$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public abstract java.lang.String getAbstractVal();
|
public abstract java.lang.String getAbstractVal();
|
||||||
|
|
||||||
@Anno(value = "v-property")
|
@Anno(value = "v-property")
|
||||||
public static void v$annotations() {
|
public static void getV$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public final class Bar {
|
|||||||
|
|
||||||
@Anno()
|
@Anno()
|
||||||
@PropertyAnno()
|
@PropertyAnno()
|
||||||
public static void a$annotations() {
|
public static void getA$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
@@ -43,7 +43,7 @@ public final class Baz {
|
|||||||
public final java.lang.String a = "";
|
public final java.lang.String a = "";
|
||||||
|
|
||||||
@Anno()
|
@Anno()
|
||||||
public static void a$annotations() {
|
public static void getA$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Baz() {
|
public Baz() {
|
||||||
@@ -75,7 +75,7 @@ public final class Foo {
|
|||||||
private final java.lang.String a = null;
|
private final java.lang.String a = null;
|
||||||
|
|
||||||
@PropertyAnno()
|
@PropertyAnno()
|
||||||
public static void a$annotations() {
|
public static void getA$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public final class Test {
|
|||||||
* prop2.
|
* prop2.
|
||||||
*/
|
*/
|
||||||
@Anno()
|
@Anno()
|
||||||
public static void prop2$annotations() {
|
public static void getProp2$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public final class JvmStaticTest {
|
|||||||
@kotlin.Metadata()
|
@kotlin.Metadata()
|
||||||
public static final class Companion {
|
public static final class Companion {
|
||||||
|
|
||||||
public static void one$annotations() {
|
public static void getOne$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getOne() {
|
public final int getOne() {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public final class Test {
|
|||||||
@kotlin.Metadata()
|
@kotlin.Metadata()
|
||||||
public static final class A {
|
public static final class A {
|
||||||
|
|
||||||
public static void test$annotations() {
|
public static void getTest$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ public final class MyActivity {
|
|||||||
private final int propF = 0;
|
private final int propF = 0;
|
||||||
|
|
||||||
@Bind(id = lib.R.id.textView)
|
@Bind(id = lib.R.id.textView)
|
||||||
public static void a$annotations() {
|
public static void getA$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getA() {
|
public final int getA() {
|
||||||
@@ -144,7 +144,7 @@ public final class MyActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bind(id = lib.R.id.textView)
|
@Bind(id = lib.R.id.textView)
|
||||||
public static void b$annotations() {
|
public static void getB$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getB() {
|
public final int getB() {
|
||||||
@@ -152,7 +152,7 @@ public final class MyActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bind(id = app.R.layout.mainActivity)
|
@Bind(id = app.R.layout.mainActivity)
|
||||||
public static void c$annotations() {
|
public static void getC$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getC() {
|
public final int getC() {
|
||||||
@@ -160,7 +160,7 @@ public final class MyActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bind(id = app.R.layout.mainActivity)
|
@Bind(id = app.R.layout.mainActivity)
|
||||||
public static void d$annotations() {
|
public static void getD$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getD() {
|
public final int getD() {
|
||||||
@@ -169,7 +169,7 @@ public final class MyActivity {
|
|||||||
|
|
||||||
@Anno(a1 = app.B.a1, a2 = app.B.a2, a3 = app.B.a3, a4 = app.B.a4, a5 = app.B.a5, a6 = app.B.a6, a7 = app.B.a7, a8 = app.B.a8, a9 = "A")
|
@Anno(a1 = app.B.a1, a2 = app.B.a2, a3 = app.B.a3, a4 = app.B.a4, a5 = app.B.a5, a6 = app.B.a6, a7 = app.B.a7, a8 = app.B.a8, a9 = "A")
|
||||||
@Bind(id = app.R2.layout.mainActivity)
|
@Bind(id = app.R2.layout.mainActivity)
|
||||||
public static void e$annotations() {
|
public static void getE$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getE() {
|
public final int getE() {
|
||||||
@@ -177,7 +177,7 @@ public final class MyActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bind(id = app.B.id.textView)
|
@Bind(id = app.B.id.textView)
|
||||||
public static void f$annotations() {
|
public static void getF$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getF() {
|
public final int getF() {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public final class Test {
|
|||||||
|
|
||||||
@Anno2()
|
@Anno2()
|
||||||
@Anno()
|
@Anno()
|
||||||
public static void prop$annotations() {
|
public static void getProp$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ public final class Test {
|
|||||||
@lib.Anno(value = "3", construct = {"C"})
|
@lib.Anno(value = "3", construct = {"C"})
|
||||||
@lib.Anno(value = "2", construct = {"A", "B"})
|
@lib.Anno(value = "2", construct = {"A", "B"})
|
||||||
@lib.Anno(value = "1")
|
@lib.Anno(value = "1")
|
||||||
public static void value$annotations() {
|
public static void getValue$annotations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public final class TopLevelKt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Anno(value = "extpr")
|
@Anno(value = "extpr")
|
||||||
public static void extensionProperty$annotations(java.lang.Object p0) {
|
public static void getExtensionProperty$annotations(java.lang.Object p0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
|||||||
Reference in New Issue
Block a user