Analysis API: fix annotation rendering for types

This commit is contained in:
Ilya Kirillov
2021-11-18 19:09:21 +01:00
parent 3a5e503f29
commit 193df3e3c4
18 changed files with 262 additions and 75 deletions
@@ -1,4 +1,4 @@
@Target(allowedTargets = NOT_CONST_EXPRESSION) annotation class base
@Target(allowedTargets = [kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS]) annotation class base
@base annotation class derived
@base class correct {
constructor(x: Int)
@@ -1,4 +1,4 @@
@Target(allowedTargets = NOT_CONST_EXPRESSION) annotation class base
@Target(allowedTargets = [kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS]) annotation class base
@base annotation class derived
@base class correct {
constructor(@base x: Int)
@@ -0,0 +1,9 @@
@Target(AnnotationTarget.TYPE)
annotation class A1
@Target(AnnotationTarget.TYPE)
annotation class A2(val value: String)
fun x(): @A1 @A2("LIST") List<@A2("INT") Int> {
TODO()
}
@@ -0,0 +1,6 @@
@Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE]) annotation class A1
@Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE]) annotation class A2 {
constructor(value: String)
val value: String
}
fun x(): @A1 @A2(value = "LIST") List<@A2(value = "INT") Int>
@@ -0,0 +1,6 @@
@Target(AnnotationTarget.TYPE)
annotation class A(val value: Int)
fun x(): @A(1 + 2) Int {
TODO()
}
@@ -0,0 +1,5 @@
@Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE]) annotation class A {
constructor(value: Int)
val value: Int
}
fun x(): @A(value = 3) Int
@@ -0,0 +1,3 @@
@Target(allowedTargets = [kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.VALUE_PARAMETER, kotlin.annotation.AnnotationTarget.TYPE]) annotation class base
fun foo1(vararg ints: Int)
fun foo2(@base vararg ints: @base Int)
@@ -1,3 +1,3 @@
@Target(allowedTargets = NOT_CONST_EXPRESSION) annotation class base
@Target(allowedTargets = [kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.VALUE_PARAMETER, kotlin.annotation.AnnotationTarget.TYPE]) annotation class base
fun foo1(vararg ints: Int)
fun foo2(@base vararg ints: @base Int)
fun foo2(@base vararg ints: Int)