Refactor: AnnotationSerializer does not depend on bultins

This commit is contained in:
Pavel V. Talanov
2015-07-17 15:35:03 +03:00
parent 251ebc7ca8
commit aae8ccfd57
8 changed files with 28 additions and 29 deletions
@@ -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