[K2] Rewrite the way of extraction const values from IR for FIR

Right now it is much easier to extract constant values from
`EvaluatedConstTracker`

#KT-57928
#KT-57929
This commit is contained in:
Ivan Kylchik
2023-04-08 14:55:56 +02:00
committed by Space Team
parent 1ddcdcfc39
commit 45aacae945
10 changed files with 82 additions and 299 deletions
@@ -30,12 +30,12 @@ abstract class IntegerValueConstant<out T> protected constructor(value: T) : Con
abstract class UnsignedValueConstant<out T> protected constructor(value: T) : ConstantValue<T>(value)
class AnnotationValue private constructor(value: Value) : ConstantValue<AnnotationValue.Value>(value) {
class Value(val type: KotlinTypeMarker, val argumentsMapping: Map<Name, ConstantValue<*>?>)
class Value(val type: KotlinTypeMarker, val argumentsMapping: Map<Name, ConstantValue<*>>)
override fun <R, D> accept(visitor: AnnotationArgumentVisitor<R, D>, data: D): R = visitor.visitAnnotationValue(this, data)
companion object {
fun create(type: KotlinTypeMarker, argumentsMapping: Map<Name, ConstantValue<*>?>): AnnotationValue {
fun create(type: KotlinTypeMarker, argumentsMapping: Map<Name, ConstantValue<*>>): AnnotationValue {
return AnnotationValue(
Value(type, argumentsMapping)
)