Analysis API: fix invalid psi elements for constants and annotation values
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ public data class KtAnnotationApplication(
|
||||
*
|
||||
* Present only for declarations from sources. For declarations from other places (libraries, stdlib) it's `null`
|
||||
*/
|
||||
public val psi: KtAnnotationEntry?,
|
||||
public val psi: KtCallElement?,
|
||||
|
||||
/**
|
||||
* [AnnotationUseSiteTarget] to which annotation was applied. May be not-null only for annotation applications for declarations.
|
||||
|
||||
+9
-5
@@ -26,15 +26,17 @@ import org.jetbrains.kotlin.psi.KtElement
|
||||
* [KtAnnotationApplicationValue] represents annotation types (with annotation fq name and arguments); and
|
||||
* [KtArrayAnnotationValue] abstracts an array of [KtAnnotationValue]s.
|
||||
*/
|
||||
public sealed class KtAnnotationValue(
|
||||
public open val sourcePsi: KtElement? = null
|
||||
)
|
||||
public sealed class KtAnnotationValue {
|
||||
public abstract val sourcePsi: KtElement?
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This represents an unsupported expression used as an annotation value.
|
||||
*/
|
||||
public object KtUnsupportedAnnotationValue : KtAnnotationValue()
|
||||
public object KtUnsupportedAnnotationValue : KtAnnotationValue() {
|
||||
override val sourcePsi: KtElement? get() = null
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of annotation values. E.g: `@A([1, 2])`
|
||||
@@ -116,7 +118,9 @@ public class KtEnumEntryAnnotationValue(
|
||||
*/
|
||||
public class KtConstantAnnotationValue(
|
||||
public val constantValue: KtConstantValue,
|
||||
) : KtAnnotationValue()
|
||||
) : KtAnnotationValue() {
|
||||
override val sourcePsi: KtElement? get() = constantValue.sourcePsi
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user