aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-18 13:57:52 +0100
committerMartin Odersky <odersky@gmail.com>2017-04-06 13:15:28 +0200
commite4d499945b93f95bbff7e9fe71aeffc9af4fc8bd (patch)
treef07ff4b6dae3bb30bef7d4f924b5013f427acc26 /compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
parentc67217594bb40e1eab7e567c97bdf29ac0654864 (diff)
downloaddotty-e4d499945b93f95bbff7e9fe71aeffc9af4fc8bd.tar.gz
dotty-e4d499945b93f95bbff7e9fe71aeffc9af4fc8bd.tar.bz2
dotty-e4d499945b93f95bbff7e9fe71aeffc9af4fc8bd.zip
Handle hk lambdas in tasty
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala20
1 files changed, 11 insertions, 9 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
index 4c600564d..fc9d9c447 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
@@ -253,12 +253,12 @@ class TreePickler(pickler: TastyPickler) {
case tpe: ExprType =>
writeByte(BYNAMEtype)
pickleType(tpe.underlying)
- case tpe: TypeLambda =>
- writeByte(POLYtype)
- pickleMethodic(tpe.resultType, tpe.paramNames, tpe.paramInfos)
+ case tpe: HKTypeLambda =>
+ pickleMethodic(TYPELAMBDAtype, tpe)
+ case tpe: PolyType /*if richTypes*/ => //###
+ pickleMethodic(POLYtype, tpe)
case tpe: MethodType if richTypes =>
- writeByte(METHODtype)
- pickleMethodic(tpe.resultType, tpe.paramNames, tpe.paramInfos)
+ pickleMethodic(METHODtype, tpe)
case tpe: TypeParamRef =>
if (!pickleParamRef(tpe))
// TODO figure out why this case arises in e.g. pickling AbstractFileReader.
@@ -281,13 +281,15 @@ class TreePickler(pickler: TastyPickler) {
pickleName(qualifiedName(pkg))
}
- def pickleMethodic(result: Type, names: List[Name], types: List[Type])(implicit ctx: Context) =
+ def pickleMethodic(tag: Int, tpe: LambdaType)(implicit ctx: Context) = {
+ writeByte(tag)
withLength {
- pickleType(result, richTypes = true)
- (names, types).zipped.foreach { (name, tpe) =>
+ pickleType(tpe.resultType, richTypes = true)
+ (tpe.paramNames, tpe.paramInfos).zipped.foreach { (name, tpe) =>
pickleName(name); pickleType(tpe)
}
}
+ }
def pickleParamRef(tpe: ParamRef)(implicit ctx: Context): Boolean = {
val binder = pickledTypes.get(tpe.binder)
@@ -554,7 +556,7 @@ class TreePickler(pickler: TastyPickler) {
writeByte(ANNOTATEDtpt)
withLength { pickleTree(tree); pickleTree(annot.tree) }
case LambdaTypeTree(tparams, body) =>
- writeByte(POLYtpt)
+ writeByte(LAMBDAtpt)
withLength { pickleParams(tparams); pickleTree(body) }
case TypeBoundsTree(lo, hi) =>
writeByte(TYPEBOUNDStpt)