aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/TreePickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-03-05 10:09:55 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-18 11:14:14 +0100
commit7fd242f2f1b1d2f536e73ec0fdb92a34b27b2a89 (patch)
tree00abf33212527f2204571777ca1793ffcf7fabbe /src/dotty/tools/dotc/core/pickling/TreePickler.scala
parenta4b2a67fa5d58f7dbd34b8876e8a87e309524e22 (diff)
downloaddotty-7fd242f2f1b1d2f536e73ec0fdb92a34b27b2a89.tar.gz
dotty-7fd242f2f1b1d2f536e73ec0fdb92a34b27b2a89.tar.bz2
dotty-7fd242f2f1b1d2f536e73ec0fdb92a34b27b2a89.zip
More fixes to pickling
- treat applied higher-kinded types specially when pickling ( drop #Apply projection) - pickle the original self info sintead of the processed self type
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/TreePickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/TreePickler.scala19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/TreePickler.scala b/src/dotty/tools/dotc/core/pickling/TreePickler.scala
index b8f031ec5..ef986b898 100644
--- a/src/dotty/tools/dotc/core/pickling/TreePickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/TreePickler.scala
@@ -6,7 +6,7 @@ package pickling
import ast.Trees._
import PickleFormat._
import core._
-import Contexts._, Symbols._, Types._, Names._, Constants._, Decorators._, Annotations._
+import Contexts._, Symbols._, Types._, Names._, Constants._, Decorators._, Annotations._, StdNames.tpnme
import collection.mutable
import TastyBuffer._
@@ -161,8 +161,14 @@ class TreePickler(pickler: TastyPickler) {
writeByte(TERMREF)
pickleNameAndSig(tpe.name, tpe.signature); pickleType(tpe.prefix)
case tpe: NamedType =>
- writeByte(if (tpe.isType) TYPEREF else TERMREF)
- pickleName(tpe.name); pickleType(tpe.prefix)
+ if (tpe.name == tpnme.Apply && tpe.prefix.argInfos.nonEmpty && tpe.prefix.isInstantiatedLambda)
+ // instantiated lambdas are pickled as APPLIEDTYPE; #Apply will
+ // be reconstituted when unpickling.
+ pickleType(tpe.prefix)
+ else {
+ writeByte(if (tpe.isType) TYPEREF else TERMREF)
+ pickleName(tpe.name); pickleType(tpe.prefix)
+ }
case tpe: ThisType =>
writeByte(THIS)
pickleType(tpe.tref)
@@ -391,7 +397,12 @@ class TreePickler(pickler: TastyPickler) {
if ((selfInfo ne NoType) || !tree.self.isEmpty) {
writeByte(SELFDEF)
pickleName(tree.self.name)
- pickleType(cinfo.selfType)
+ pickleType {
+ cinfo.selfInfo match {
+ case sym: Symbol => sym.info
+ case tp: Type => tp
+ }
+ }
}
pickleStats(tree.constr :: rest)
}