FIR: fix order of property accessor annotations
#KT-57219 Fixed
This commit is contained in:
committed by
Space Team
parent
9c995755f0
commit
40c628d431
-3
@@ -1,3 +0,0 @@
|
||||
@GetAnnotation
|
||||
@ExplicitGetAnnotation
|
||||
get()
|
||||
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
KtPropertyGetterSymbol:
|
||||
annotationsList: [
|
||||
GetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitGetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
@ExplicitGetAnnotation
|
||||
@GetAnnotation
|
||||
@ExplicitGetAnnotation
|
||||
get()
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
KtPropertyGetterSymbol:
|
||||
annotationsList: [
|
||||
ExplicitGetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
GetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitGetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
@GetAnnotation
|
||||
@ExplicitGetAnnotation
|
||||
get()
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
KtPropertyGetterSymbol:
|
||||
annotationsList: [
|
||||
GetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitGetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverParameter: KtReceiverParameterSymbol:
|
||||
annotationsList: [
|
||||
ReceiverAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
origin: SOURCE
|
||||
owningCallableSymbol: KtKotlinPropertySymbol(/x)
|
||||
type: KtUsualClassType:
|
||||
annotationsList: [
|
||||
ReceiverTypeAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
ownTypeArguments: []
|
||||
type: @R|ReceiverTypeAnnotation|() kotlin/Long
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
analysis/analysis-api/testData/symbols/singleSymbolByPsi/getterWithReceiverAndAnnotations.pretty.txt
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
@ExplicitGetAnnotation
|
||||
@GetAnnotation
|
||||
@ExplicitGetAnnotation
|
||||
get()
|
||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
||||
KtPropertyGetterSymbol:
|
||||
annotationsList: [
|
||||
ExplicitGetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
GetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitGetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
@PropertyAnnotation
|
||||
var x: kotlin.Int
|
||||
@GetAnnotation
|
||||
@ExplicitGetAnnotation
|
||||
get()
|
||||
@SetAnnotation
|
||||
@ExplicitSetAnnotation
|
||||
set(@ExplicitSetparamAnnotation @SetparamAnnotation value: kotlin.Int)
|
||||
-167
@@ -1,167 +0,0 @@
|
||||
KtKotlinPropertySymbol:
|
||||
annotationsList: [
|
||||
PropertyAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
backingFieldSymbol: KtBackingFieldSymbol:
|
||||
annotationsList: [
|
||||
FieldAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
isExtension: false
|
||||
name: field
|
||||
origin: PROPERTY_BACKING_FIELD
|
||||
owningProperty: KtKotlinPropertySymbol(/x)
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
callableIdIfNonLocal: /x
|
||||
contextReceivers: []
|
||||
getter: KtPropertyGetterSymbol:
|
||||
annotationsList: [
|
||||
GetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitGetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
hasBackingField: true
|
||||
hasGetter: true
|
||||
hasSetter: true
|
||||
initializer: KtConstantInitializerValue(0)
|
||||
isConst: false
|
||||
isDelegatedProperty: false
|
||||
isExtension: false
|
||||
isFromPrimaryConstructor: false
|
||||
isLateInit: false
|
||||
isOverride: false
|
||||
isStatic: false
|
||||
isVal: false
|
||||
modality: FINAL
|
||||
name: x
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
setter: KtPropertySetterSymbol:
|
||||
annotationsList: [
|
||||
SetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitSetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
parameter: KtValueParameterSymbol:
|
||||
annotationsList: [
|
||||
ExplicitSetparamAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
SetparamAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Unit
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: [
|
||||
ExplicitSetparamAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
SetparamAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
]
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
symbolKind: TOP_LEVEL
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getX
|
||||
javaSetterName: setX
|
||||
setterDeprecationStatus: null
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
@PropertyAnnotation
|
||||
var x: kotlin.Int
|
||||
@ExplicitGetAnnotation
|
||||
@GetAnnotation
|
||||
@ExplicitGetAnnotation
|
||||
get()
|
||||
@ExplicitSetAnnotation
|
||||
@SetAnnotation
|
||||
@ExplicitSetAnnotation
|
||||
set(@ExplicitSetparamAnnotation @SetparamAnnotation value: kotlin.Int)
|
||||
Vendored
+4
-4
@@ -27,10 +27,10 @@ KtKotlinPropertySymbol:
|
||||
contextReceivers: []
|
||||
getter: KtPropertyGetterSymbol:
|
||||
annotationsList: [
|
||||
ExplicitGetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
GetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitGetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
@@ -75,10 +75,10 @@ KtKotlinPropertySymbol:
|
||||
type: kotlin/Int
|
||||
setter: KtPropertySetterSymbol:
|
||||
annotationsList: [
|
||||
ExplicitSetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
SetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitSetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
@SetAnnotation
|
||||
@ExplicitSetAnnotation
|
||||
set(@ExplicitSetparamAnnotation @SetparamAnnotation value: kotlin.Int)
|
||||
Vendored
-83
@@ -1,83 +0,0 @@
|
||||
KtPropertySetterSymbol:
|
||||
annotationsList: [
|
||||
SetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitSetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: true
|
||||
hasStableParameterNames: true
|
||||
isDefault: false
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE
|
||||
parameter: KtValueParameterSymbol:
|
||||
annotationsList: [
|
||||
ExplicitSetparamAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
SetparamAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Unit
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: [
|
||||
ExplicitSetparamAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
SetparamAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
]
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
@ExplicitSetAnnotation
|
||||
@SetAnnotation
|
||||
@ExplicitSetAnnotation
|
||||
set(@ExplicitSetparamAnnotation @SetparamAnnotation value: kotlin.Int)
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
KtPropertySetterSymbol:
|
||||
annotationsList: [
|
||||
ExplicitSetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
SetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
ExplicitSetAnnotation()
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
|
||||
+1
-1
@@ -1457,8 +1457,8 @@ class DeclarationsConverter(
|
||||
this.isGetter = isGetter
|
||||
this.status = status
|
||||
context.firFunctionTargets += target
|
||||
annotations += modifiers.annotations
|
||||
annotations += accessorAdditionalAnnotations
|
||||
annotations += modifiers.annotations
|
||||
|
||||
if (!isGetter) {
|
||||
valueParameters += firValueParameters
|
||||
|
||||
@@ -453,8 +453,8 @@ open class RawFirBuilder(
|
||||
}
|
||||
this.isGetter = isGetter
|
||||
this.status = status
|
||||
extractAnnotationsTo(this)
|
||||
annotations += accessorAnnotationsFromProperty
|
||||
extractAnnotationsTo(this)
|
||||
this@RawFirBuilder.context.firFunctionTargets += accessorTarget
|
||||
symbol = FirPropertyAccessorSymbol()
|
||||
extractValueParametersTo(
|
||||
|
||||
Vendored
+6
-4
@@ -4,9 +4,6 @@
|
||||
// FULL_JDK
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
// IGNORE_BACKEND_K2: JVM_IR
|
||||
// FIR status: KT-57219 K2: incorrect relative order of normal and use-site-targeted annotations on property getter in the resulting bytecode
|
||||
|
||||
@Repeatable
|
||||
annotation class A(val v: String)
|
||||
|
||||
@@ -21,5 +18,10 @@ val ef: Int
|
||||
@A("e") @A("f") get() = 0
|
||||
|
||||
@get:A("g")
|
||||
val ghi: Int
|
||||
val gh: Int
|
||||
@A("h") get() = 0
|
||||
|
||||
@set:A("i")
|
||||
var ij: Int
|
||||
get() = 0
|
||||
@A("j") set(value) {}
|
||||
|
||||
Vendored
+3
-1
@@ -25,6 +25,8 @@ public final class PropertyGetterUseSiteTargetKt {
|
||||
public final static @A$Container(value=[A(v="a"), A(v="b")]) method getAb(): int
|
||||
public final static @A$Container(value=[A(v="c"), A(v="d")]) method getCd(): int
|
||||
public final static @A$Container(value=[A(v="e"), A(v="f")]) method getEf(): int
|
||||
public final static @A$Container(value=[A(v="g"), A(v="h")]) method getGhi(): int
|
||||
public final static @A$Container(value=[A(v="g"), A(v="h")]) method getGh(): int
|
||||
public final static method getIj(): int
|
||||
public final static @A$Container(value=[A(v="i"), A(v="j")]) method setIj(p0: int): void
|
||||
public inner class A$Container
|
||||
}
|
||||
|
||||
+6
-6
@@ -4,19 +4,19 @@
|
||||
// Ann is not repeatable
|
||||
annotation class Ann(val x: Int)
|
||||
|
||||
<!REPEATED_ANNOTATION!>@get:Ann(10)<!>
|
||||
@get:Ann(10)
|
||||
val a: String
|
||||
@Ann(20) get() = "foo"
|
||||
<!REPEATED_ANNOTATION!>@Ann(20)<!> get() = "foo"
|
||||
|
||||
<!REPEATED_ANNOTATION!>@set:Ann(10)<!>
|
||||
@set:Ann(10)
|
||||
var b: String = ""
|
||||
@Ann(20) set(value) { field = value }
|
||||
<!REPEATED_ANNOTATION!>@Ann(20)<!> set(value) { field = value }
|
||||
|
||||
<!REPEATED_ANNOTATION!>@setparam:Ann(10)<!>
|
||||
var c = " "
|
||||
set(@Ann(20) x) {}
|
||||
|
||||
<!REPEATED_ANNOTATION!>@get:Ann(10)<!>
|
||||
@get:Ann(10)
|
||||
<!REPEATED_ANNOTATION!>@get:Ann(20)<!>
|
||||
val d: String
|
||||
@Ann(30) <!REPEATED_ANNOTATION!>@Ann(40)<!> get() = "foo"
|
||||
<!REPEATED_ANNOTATION!>@Ann(30)<!> <!REPEATED_ANNOTATION!>@Ann(40)<!> get() = "foo"
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !LANGUAGE: +ProhibitRepeatedUseSiteTargetAnnotations
|
||||
|
||||
// Ann is not repeatable
|
||||
annotation class Ann(val x: Int)
|
||||
|
||||
@get:Ann(10)
|
||||
val a: String
|
||||
<!REPEATED_ANNOTATION!>@Ann(20)<!> get() = "foo"
|
||||
|
||||
@set:Ann(10)
|
||||
var b: String = ""
|
||||
<!REPEATED_ANNOTATION!>@Ann(20)<!> set(value) { field = value }
|
||||
|
||||
<!REPEATED_ANNOTATION!>@setparam:Ann(10)<!>
|
||||
var c = " "
|
||||
set(@Ann(20) x) {}
|
||||
|
||||
@get:Ann(10)
|
||||
<!REPEATED_ANNOTATION!>@get:Ann(20)<!>
|
||||
val d: String
|
||||
<!REPEATED_ANNOTATION!>@Ann(30)<!> <!REPEATED_ANNOTATION!>@Ann(40)<!> get() = "foo"
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !LANGUAGE: +ProhibitRepeatedUseSiteTargetAnnotations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user