aboutsummaryrefslogtreecommitdiff
path: root/test-utils
diff options
context:
space:
mode:
authorJiaxiang Chen <jiaxiang@google.com>2023-01-25 13:25:03 -0800
committerKSP Auto Pick <kotlin-symbol-processing@google.com>2023-01-26 00:39:26 +0000
commit354e861d5837a16a780f6beb17f902b77c4aff18 (patch)
tree30f137e19322d58bbd7cbe769c38bdcb21043ffa /test-utils
parent0bad1aa1955d2c9bd81033a5a3d4d50fea3daee6 (diff)
downloadksp-354e861d5837a16a780f6beb17f902b77c4aff18.tar.gz
handle more implicit annotation use site targets for value parameter
(cherry picked from commit e3ce61c4a1de91026a1c5b94ae15ef5458148509)
Diffstat (limited to 'test-utils')
-rw-r--r--test-utils/testData/api/annotationInDependencies.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/test-utils/testData/api/annotationInDependencies.kt b/test-utils/testData/api/annotationInDependencies.kt
index 9c959512..705bc560 100644
--- a/test-utils/testData/api/annotationInDependencies.kt
+++ b/test-utils/testData/api/annotationInDependencies.kt
@@ -56,15 +56,13 @@
// class main.DataClass : annotations.NoTargetAnnotation{[value = onDataClass]}
// getter of property constructorParam : annotations.PropertyGetterTarget{[value = get:]}
// parameter <set-?> : annotations.ValueParameterTarget{[value = onConstructorParam]}
-// parameter constructorParam : annotations.FieldTarget2{[value = field:]}
-// parameter constructorParam : annotations.FieldTarget{[value = onConstructorParam]}
// parameter constructorParam : annotations.NoTargetAnnotation{[value = onConstructorParam]}
-// parameter constructorParam : annotations.PropertyTarget{[value = onConstructorParam]}
// parameter constructorParam : annotations.ValueParameterTarget{[value = onConstructorParam]}
// property constructorParam : annotations.FieldTarget2{[value = field:]}
// property constructorParam : annotations.FieldTarget{[value = onConstructorParam]}
// property constructorParam : annotations.NoTargetAnnotation{[value = onConstructorParam]}
// property constructorParam : annotations.PropertyTarget{[value = onConstructorParam]}
+// property constructorParam : annotations.ValueParameterAndFieldTarget{[value = valueParameterAndField]}
// setter of property constructorParam : annotations.PropertySetterTarget{[value = set:]}
// lib.DataClass ->
// class lib.DataClass : annotations.ClassTarget{[value = onDataClass]}
@@ -104,6 +102,10 @@ annotation class FunctionTarget(val value:String)
@Target(AnnotationTarget.VALUE_PARAMETER)
annotation class ValueParameterTarget(val value:String)
+
+@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD)
+annotation class ValueParameterAndFieldTarget(val value: String)
+
// MODULE: lib(annotations)
// FILE: ClassInLib.kt
package lib;
@@ -187,6 +189,7 @@ class DataClass(
@set:PropertySetterTarget("set:")
@get:PropertyGetterTarget("get:")
@field:FieldTarget2("field:")
+ @field:ValueParameterAndFieldTarget("valueParameterAndField")
@setparam:ValueParameterTarget("onConstructorParam")
@ValueParameterTarget("onConstructorParam")
var constructorParam : String = ""