Refactor: AnnotationSerializer does not depend on bultins
This commit is contained in:
@@ -52,7 +52,7 @@ public class ConstantValueFactory(
|
||||
fun createArrayValue(
|
||||
value: List<ConstantValue<*>>,
|
||||
type: JetType
|
||||
) = ArrayValue(value, type)
|
||||
) = ArrayValue(value, type, builtins)
|
||||
|
||||
fun createAnnotationValue(value: AnnotationDescriptor) = AnnotationValue(value)
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ public class AnnotationValue(value: AnnotationDescriptor) : ConstantValue<Annota
|
||||
|
||||
public class ArrayValue(
|
||||
value: List<ConstantValue<*>>,
|
||||
override val type: JetType
|
||||
override val type: JetType,
|
||||
private val builtIns: KotlinBuiltIns
|
||||
) : ConstantValue<List<ConstantValue<*>>>(value) {
|
||||
|
||||
init {
|
||||
@@ -55,6 +56,9 @@ public class ArrayValue(
|
||||
|
||||
override fun <R, D> accept(visitor: AnnotationArgumentVisitor<R, D>, data: D) = visitor.visitArrayValue(this, data)
|
||||
|
||||
public val elementType: JetType
|
||||
get() = builtIns.getArrayElementType(type)
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
Reference in New Issue
Block a user