1/2 Refactoring: split GetterAnnotations & PropertyAnnotations tests for K1 and K2
These tests won't be FIR_IDENTICAL after the next commit. That's why I split them prematurely. This allows me to have a nicer diff in `2/2` commit. In scope of KT-15470 Review: https://jetbrains.team/p/kt/reviews/9250
This commit is contained in:
Vendored
+39
@@ -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
|
||||
}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
|
||||
class SomeClass {
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@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) {}
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
|
||||
fun anotherFun() {
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
|
||||
val localVariable = 5
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user