diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.fir.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.fir.kt new file mode 100644 index 00000000000..9510423cb9e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.fir.kt @@ -0,0 +1,39 @@ +import kotlin.reflect.KProperty + +annotation class Ann + +class CustomDelegate { + operator fun getValue(thisRef: Any?, prop: KProperty<*>): String = prop.name +} + +@get:Ann +class SomeClass { + + @get:Ann + constructor() + + @get:Ann + protected val simpleProperty: String = "text" + + @get:Ann + protected var mutableProperty: String = "text" + + @get:[Ann] + protected val simplePropertyWithAnnotationList: String = "text" + + @get:Ann + protected val delegatedProperty: String by CustomDelegate() + + @get:Ann + val propertyWithCustomGetter: Int + get() = 5 + + @get:Ann + fun annotationOnFunction(a: Int) = a + 5 + + fun anotherFun() { + @get:Ann + val localVariable = 5 + } + +} diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt index f96c94322c0..9510423cb9e 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL import kotlin.reflect.KProperty annotation class Ann diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.fir.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.fir.kt new file mode 100644 index 00000000000..aa5989a5fda --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.fir.kt @@ -0,0 +1,39 @@ +import kotlin.reflect.KProperty + +annotation class Ann +annotation class Second + +class CustomDelegate { + operator fun getValue(thisRef: Any?, prop: KProperty<*>): String = prop.name +} + +@property:Ann +class SomeClass { + + @property:Ann + constructor(s: String) + + @property:Ann + protected val p1: String = "" + + @property:[Ann Second] + protected val p2: String = "" + + @property:Ann + protected var p3: String = "" + + @property:Ann + protected val p4: String by CustomDelegate() + + @property:Ann + var propertyWithCustomSetter: Int + get() = 5 + set(v) {} + + @property:Ann + fun anotherFun() { + @property:Ann + val localVariable = 5 + } + +} diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt index b98e7981c50..aa5989a5fda 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL import kotlin.reflect.KProperty annotation class Ann