[Analysis API] add tests on KtType conversion with annotations

^KT-66603
This commit is contained in:
Dmitrii Gridin
2024-03-14 16:57:29 +01:00
committed by Space Team
parent 6ba69482af
commit cd4f87a8f3
8 changed files with 73 additions and 0 deletions
@@ -0,0 +1,13 @@
package foo
@Target(AnnotationTarget.TYPE)
annotation class MyAnno(val s: String)
@Target(AnnotationTarget.TYPE)
annotation class AnotherAnnotation(val k: KClass<*>)
class Nested
fun f<caret>oo(): @MyAnno("outer") List<@MyAnno("middle") List<@AnotherAnnotation(Nested::class) String>> {
}
@@ -0,0 +1,2 @@
KtType: @foo.MyAnno(s = "outer") kotlin.collections.List<@foo.MyAnno(s = "middle") kotlin.collections.List<@foo.AnotherAnnotation(k = foo.Nested::class) kotlin.String>>
PsiType: java.util.List<? extends java.util.List<? extends java.lang.String>>
@@ -0,0 +1,8 @@
package foo
@Target(AnnotationTarget.TYPE)
annotation class MyAnno(val s: String)
fun f<caret>oo(): @MyAnno("str" + "1") String {
}
@@ -0,0 +1,2 @@
KtType: @foo.MyAnno(s = "str1") kotlin.String
PsiType: java.lang.String