diff options
author | Dmitry Petrashko <dark@d-d.me> | 2014-11-24 13:51:44 +0100 |
---|---|---|
committer | Dmitry Petrashko <dark@d-d.me> | 2014-11-24 13:51:44 +0100 |
commit | 779afd2f65f967ec5af1ac5ec7464ad5851852ad (patch) | |
tree | af6d2ff5b81ee10e7a427ec7b36a2ac5639981a3 /src/dotty/tools/dotc/core/pickling/UnPickler.scala | |
parent | 33feb9dea9db0695f510654348455133707e0740 (diff) | |
parent | 859a7fe21d4e2b9a2f336bc38815b21367a2993b (diff) | |
download | dotty-779afd2f65f967ec5af1ac5ec7464ad5851852ad.tar.gz dotty-779afd2f65f967ec5af1ac5ec7464ad5851852ad.tar.bz2 dotty-779afd2f65f967ec5af1ac5ec7464ad5851852ad.zip |
Merge pull request #213 from dotty-staging/javaparser
Javaparser & ElimRepeated fixes & Annotation-fixes
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/UnPickler.scala | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala index 60000441c..728048700 100644 --- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala +++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala @@ -9,8 +9,9 @@ import java.lang.Double.longBitsToDouble import Contexts._, Symbols._, Types._, Scopes._, SymDenotations._, Names._, NameOps._ import StdNames._, Denotations._, NameOps._, Flags._, Constants._, Annotations._ +import dotty.tools.dotc.typer.ProtoTypes.{FunProtoTyped, FunProto} import util.Positions._ -import ast.Trees, ast.tpd._, ast.untpd +import dotty.tools.dotc.ast.{tpd, Trees, untpd}, ast.tpd._ import printing.Texts._ import printing.Printer import io.AbstractFile @@ -815,19 +816,26 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: */ protected def readAnnotationContents(end: Int)(implicit ctx: Context): Tree = { val atp = readTypeRef() - val args = new ListBuffer[Tree] - while (readIndex != end) { - val argref = readNat() - args += { - if (isNameEntry(argref)) { - val name = at(argref, readName) - val arg = readClassfileAnnotArg(readNat()) - NamedArg(name.asTermName, arg) - } else readAnnotArg(argref) + val args = { + val t = new ListBuffer[Tree] + + while (readIndex != end) { + val argref = readNat() + t += { + if (isNameEntry(argref)) { + val name = at(argref, readName) + val arg = readClassfileAnnotArg(readNat()) + NamedArg(name.asTermName, arg) + } else readAnnotArg(argref) + } } + t.toList } - New(atp, args.toList) - } + // println(atp) + val targs = atp.argTypes + + tpd.applyOverloaded(tpd.New(atp withoutArgs targs), nme.CONSTRUCTOR, args, targs, atp) +} /** Read an annotation and as a side effect store it into * the symbol it requests. Called at top-level, for all |