Analysis API: add tests to check annotations on declarations
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
@Deprecated("deprecated", level = DeprecationLevel.ERROR)
|
||||
fun f<caret>oo() {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KtDeclaration: KtNamedFunction foo
|
||||
annotations: [
|
||||
kotlin/Deprecated(level = KtEnumEntryConstantValue(kotlin/DeprecationLevel.ERROR), message = deprecated)
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
annotation class A(val a: Int, val c: KClass<*>)
|
||||
|
||||
@A(1, Int::class)
|
||||
class F<caret>oo
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KtDeclaration: KtClass Foo
|
||||
annotations: [
|
||||
A(a = 1, c = KtUnsupportedConstantValue)
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
annotation class A(val a: Int, val c: KClass<*>)
|
||||
|
||||
@A(1, Int::class)
|
||||
fun fo<caret>o(): Int = 10
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KtDeclaration: KtNamedFunction foo
|
||||
annotations: [
|
||||
A(a = 1, c = KtUnsupportedConstantValue)
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
annotation class A(val a: Int, val c: KClass<*>)
|
||||
|
||||
@A(1, Int::class)
|
||||
val f<caret>oo: Int = 10
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KtDeclaration: KtProperty foo
|
||||
annotations: [
|
||||
A(a = 1, c = KtUnsupportedConstantValue)
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
annotation class A(val a: Int, val c: KClass<*>)
|
||||
|
||||
@A(1, Int::class)
|
||||
typealias F<caret>oo = String
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KtDeclaration: KtTypeAlias Foo
|
||||
annotations: [
|
||||
A(a = 1, c = KtUnsupportedConstantValue)
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
annotation class A(val a: Int, val c: KClass<*>)
|
||||
|
||||
@get:A(1, Int::class)
|
||||
val foo : Int
|
||||
ge<caret>t() = 10
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KtDeclaration: KtPropertyAccessor null
|
||||
annotations: [
|
||||
A(a = 1, c = KtUnsupportedConstantValue)
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
annotation class A(val a: Int, val c: KClass<*>)
|
||||
|
||||
data class Foo(@param:A(1, Int::class) val ba<caret>r: String)
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KtDeclaration: KtParameter bar
|
||||
annotations: [
|
||||
A(a = 1, c = KtUnsupportedConstantValue)
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
annotation class A(val a: Int, val c: KClass<*>)
|
||||
|
||||
@property:A(1, Int::class)
|
||||
val f<caret>oo : Int
|
||||
get() = 10
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KtDeclaration: KtProperty foo
|
||||
annotations: [
|
||||
A(a = 1, c = KtUnsupportedConstantValue)
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
annotation class A(val a: Int, val c: KClass<*>)
|
||||
|
||||
@set:A(1, Int::class)
|
||||
var foo : Int
|
||||
se<caret>t(value) {
|
||||
field = value
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KtDeclaration: KtPropertyAccessor null
|
||||
annotations: [
|
||||
A(a = 1, c = KtUnsupportedConstantValue)
|
||||
psi: KtAnnotationEntry
|
||||
]
|
||||
Reference in New Issue
Block a user