aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/TreePickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-03-10 23:42:06 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-18 11:16:37 +0100
commitcb8667654ede78bd99b695196dd99a0ec6c9bfa6 (patch)
tree3e0618fdf60727828bda18dfe4d670780ad0d79c /src/dotty/tools/dotc/core/pickling/TreePickler.scala
parent79e22287def4b5bf04e7ecd02507b9e72a4134f5 (diff)
downloaddotty-cb8667654ede78bd99b695196dd99a0ec6c9bfa6.tar.gz
dotty-cb8667654ede78bd99b695196dd99a0ec6c9bfa6.tar.bz2
dotty-cb8667654ede78bd99b695196dd99a0ec6c9bfa6.zip
Drop environment from pickled closures.
It is always empty anyway. Side benefit: We can get rid of NOTYPE, too.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/TreePickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/TreePickler.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/TreePickler.scala b/src/dotty/tools/dotc/core/pickling/TreePickler.scala
index ca0ba4137..c0914421f 100644
--- a/src/dotty/tools/dotc/core/pickling/TreePickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/TreePickler.scala
@@ -248,8 +248,6 @@ class TreePickler(pickler: TastyPickler) {
assert(pickleParamType(tpe), s"orphan method parameter: $tpe")
case tpe: LazyRef =>
pickleType(tpe.ref)
- case NoType =>
- writeByte(NOTYPE)
}} catch {
case ex: AssertionError =>
println(i"error while pickling type $tpe")
@@ -353,8 +351,12 @@ class TreePickler(pickler: TastyPickler) {
writeByte(IF)
withLength{ pickleTree(cond); pickleTree(thenp); pickleTree(elsep) }
case Closure(env, meth, tpt) =>
- writeByte(CLOSURE)
- withLength{ pickleTree(meth); pickleTpt(tpt); env.foreach(pickleTree) }
+ writeByte(LAMBDA)
+ assert(env.isEmpty)
+ withLength{
+ pickleTree(meth)
+ if (tpt.tpe.exists) pickleTpt(tpt)
+ }
case Match(selector, cases) =>
writeByte(MATCH)
withLength { pickleTree(selector); cases.foreach(pickleTree) }