Analysis API: separate constant values from annotation values

This commit is contained in:
Ilya Kirillov
2021-11-23 20:44:39 +01:00
parent 47c1da2845
commit f722a54c78
53 changed files with 302 additions and 415 deletions
@@ -1,6 +0,0 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
@AnnotationInner(<expr>Annotation(strings = arrayOf("v1", "v2"))</expr>)
class C
@@ -1,6 +0,0 @@
expression: Annotation(strings = arrayOf("v1", "v2"))
constant_value: KtAnnotationConstantValue(Annotation, (strings = KtArrayConstantValue [
KtLiteralConstantValue(constantValueKind=String, value=v1)
KtLiteralConstantValue(constantValueKind=String, value=v2)
]))
constant: null
@@ -1,6 +0,0 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
@AnnotationInner(<expr>Annotation(strings = ["v1", "v2"])</expr>)
class C
@@ -1,6 +0,0 @@
expression: Annotation(strings = ["v1", "v2"])
constant_value: KtAnnotationConstantValue(Annotation, (strings = KtArrayConstantValue [
KtLiteralConstantValue(constantValueKind=String, value=v1)
KtLiteralConstantValue(constantValueKind=String, value=v2)
]))
constant: null
@@ -1,6 +0,0 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
@AnnotationInner(<expr>Annotation(*["v1", "v2"])</expr>)
class C
@@ -1,6 +0,0 @@
expression: Annotation(*["v1", "v2"])
constant_value: KtAnnotationConstantValue(Annotation, (strings = KtArrayConstantValue [
KtLiteralConstantValue(constantValueKind=String, value=v1)
KtLiteralConstantValue(constantValueKind=String, value=v2)
]))
constant: null
@@ -1,6 +0,0 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationArray(vararg val annos: Annotation)
@AnnotationArray(annos = <expr>arrayOf(Annotation("v1", "v2"), Annotation(strings = arrayOf("v3", "v4")))</expr>)
class C
@@ -1,12 +0,0 @@
expression: arrayOf(Annotation("v1", "v2"), Annotation(strings = arrayOf("v3", "v4")))
constant_value: KtArrayConstantValue [
KtAnnotationConstantValue(Annotation, (strings = KtArrayConstantValue [
KtLiteralConstantValue(constantValueKind=String, value=v1)
KtLiteralConstantValue(constantValueKind=String, value=v2)
]))
KtAnnotationConstantValue(Annotation, (strings = KtArrayConstantValue [
KtLiteralConstantValue(constantValueKind=String, value=v3)
KtLiteralConstantValue(constantValueKind=String, value=v4)
]))
]
constant: null
@@ -1,6 +0,0 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationArray(vararg val annos: Annotation)
@AnnotationArray(annos = <expr>[Annotation("v1", "v2"), Annotation(strings = ["v3", "v4"])]</expr>)
class C
@@ -1,12 +0,0 @@
expression: [Annotation("v1", "v2"), Annotation(strings = ["v3", "v4"])]
constant_value: KtArrayConstantValue [
KtAnnotationConstantValue(Annotation, (strings = KtArrayConstantValue [
KtLiteralConstantValue(constantValueKind=String, value=v1)
KtLiteralConstantValue(constantValueKind=String, value=v2)
]))
KtAnnotationConstantValue(Annotation, (strings = KtArrayConstantValue [
KtLiteralConstantValue(constantValueKind=String, value=v3)
KtLiteralConstantValue(constantValueKind=String, value=v4)
]))
]
constant: null
@@ -1,6 +0,0 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
@AnnotationInner(<expr>Annotation("v1")</expr>)
class C
@@ -1,5 +0,0 @@
expression: Annotation("v1")
constant_value: KtAnnotationConstantValue(Annotation, (strings = KtArrayConstantValue [
KtLiteralConstantValue(constantValueKind=String, value=v1)
]))
constant: null
@@ -1,6 +0,0 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
@AnnotationInner(<expr>Annotation("v1", "v2")</expr>)
class C
@@ -1,6 +0,0 @@
expression: Annotation("v1", "v2")
constant_value: KtAnnotationConstantValue(Annotation, (strings = KtArrayConstantValue [
KtLiteralConstantValue(constantValueKind=String, value=v1)
KtLiteralConstantValue(constantValueKind=String, value=v2)
]))
constant: null
@@ -1,10 +0,0 @@
enum class Color {
R,
G,
B
}
annotation class Annotation(val color : Color)
@Annotation(<expr>Color.R</expr>)
class C
@@ -1,3 +0,0 @@
expression: Color.R
constant_value: KtEnumEntryConstantValue(/Color.R)
constant: null
@@ -1,3 +1,3 @@
expression: 42
constant_value: KtLiteralConstantValue(constantValueKind=Byte, value=42)
constant: 42
constantValueKind: Byte
@@ -1,3 +1,3 @@
expression: 42 / 0
constant_value: KtErrorValue(Division by zero)
constant: null
constant: error("Division by zero")
constantValueKind: Error
@@ -1,3 +1,3 @@
expression: 42 / 0
constant_value: KtErrorValue(/ by zero)
constant: null
constant: error("/ by zero")
constantValueKind: Error
@@ -1,3 +1,3 @@
expression: 3.14
constant_value: KtLiteralConstantValue(constantValueKind=Double, value=3.14)
constant: 3.14
constantValueKind: Double
@@ -1,3 +1,3 @@
expression: 3.14f
constant_value: KtLiteralConstantValue(constantValueKind=Float, value=3.14)
constant: 3.14
constantValueKind: Float
@@ -1,3 +1,3 @@
expression: 42
constant_value: KtLiteralConstantValue(constantValueKind=Int, value=42)
constant: 42
constantValueKind: Int
@@ -1,3 +1,3 @@
expression: 42
constant_value: KtLiteralConstantValue(constantValueKind=Long, value=42)
constant: 42
constantValueKind: Long
@@ -1,3 +1,3 @@
expression: 42u
constant_value: KtLiteralConstantValue(constantValueKind=UInt, value=42)
constant: 42
constantValueKind: Long
@@ -1,3 +1,3 @@
expression: "42"
constant_value: KtLiteralConstantValue(constantValueKind=String, value=42)
constant: 42
constant: "42"
constantValueKind: String