[Analysis API] add diagnostic test for compiler annotation with argument from another module

^KT-63547
This commit is contained in:
Dmitrii Gridin
2023-12-19 14:39:31 +01:00
committed by Space Team
parent acf3f2a3a1
commit 4bd73e4ccd
7 changed files with 75 additions and 3 deletions
@@ -0,0 +1,7 @@
Diagnostics from elements:
for PSI element of type KtConstructorCalleeExpression at (34,2-12)
NO_VALUE_FOR_PARAMETER text ranges: [(115,125)]
PSI: KtConstructorCalleeExpression at (34,2-12)
for PSI element of type KtNameReferenceExpression at (32,8-10)
UNRESOLVED_REFERENCE text ranges: [(94,96)]
PSI: KtNameReferenceExpression at (32,8-10)
@@ -0,0 +1,35 @@
// ALLOW_KOTLIN_PACKAGE
// DISABLE_SEALED_INHERITOR_CALCULATOR
// MODULE: lib1
// FILE: anno.kt
package kotlin.annotation
public enum class AnnotationTarget {
CLASS;
}
// MODULE: dep(lib1)
// FILE: annotation.kt
package my.pack
import kotlin.annotation.AnnotationTarget
@Target(AnnotationTarget.CLASS)
annotation class Deprecated
// MODULE: lib2
// FILE: anno.kt
package kotlin.annotation
public enum class AnnotationTarget {
CLASS;
}
// MODULE: main(lib2, dep)
// FILE: usage.kt
package usage
import my.pack.Deprecated
@Deprecated
class Usage
@@ -0,0 +1,4 @@
Diagnostics from elements:
for PSI element of type KtAnnotationEntry at (34,1-12)
WRONG_ANNOTATION_TARGET text ranges: [(114,125)]
PSI: KtAnnotationEntry at (34,1-12)