From 65639176ce59fd64cbecd90bf5680e64e471938f Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 10 Mar 2016 17:15:20 +0100 Subject: Add second field to SeqLiteral The field keeps track of the element type. This is necessary because JavaSeqLiteral is nonvariant and the elements might be empty, so we cannot always compute the type from the element types. --- src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala') diff --git a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala index 7a13388ae..2831de3e0 100644 --- a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala +++ b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala @@ -850,8 +850,8 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas val end = readNat() + readIndex // array elements are trees representing instances of scala.annotation.Annotation SeqLiteral( - defn.SeqType.appliedTo(defn.AnnotationType :: Nil), - until(end, () => readClassfileAnnotArg(readNat()))) + until(end, () => readClassfileAnnotArg(readNat())), + TypeTree(defn.AnnotationType)) } private def readAnnotInfoArg()(implicit ctx: Context): Tree = { @@ -1063,7 +1063,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas case ARRAYVALUEtree => val elemtpt = readTreeRef() val trees = until(end, readTreeRef) - SeqLiteral(defn.SeqType.appliedTo(elemtpt.tpe :: Nil), trees) + SeqLiteral(trees, elemtpt) // note can't deal with trees passed to Java methods as arrays here case FUNCTIONtree => -- cgit v1.2.3