aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/PickleFormat.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-02-19 12:20:20 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-18 11:14:08 +0100
commited986b5256a535a50fe3c6095fe7a93376edb0fc (patch)
tree1e6d1035687c421a6fc83314fb28a2182f104084 /src/dotty/tools/dotc/core/pickling/PickleFormat.scala
parentf922a46b09cd65a421f8a61eb1979e651a8e8110 (diff)
downloaddotty-ed986b5256a535a50fe3c6095fe7a93376edb0fc.tar.gz
dotty-ed986b5256a535a50fe3c6095fe7a93376edb0fc.tar.bz2
dotty-ed986b5256a535a50fe3c6095fe7a93376edb0fc.zip
Add INSUPERCALL flag to pickle format.
Reason: It is really hard to establish when a context is a inSuperCall context when unpickling trees. The unpickler does not have the ability to look inside (untyped) trees, so it is tricky/messy to detect a super.<init> or this.<init> Apply in a constructor body. Also: Always pickle template constructors.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/PickleFormat.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/PickleFormat.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/PickleFormat.scala b/src/dotty/tools/dotc/core/pickling/PickleFormat.scala
index 72c545021..decc9a887 100644
--- a/src/dotty/tools/dotc/core/pickling/PickleFormat.scala
+++ b/src/dotty/tools/dotc/core/pickling/PickleFormat.scala
@@ -86,8 +86,7 @@ Standard-Section: "ASTs" Tree*
CaseDef = CASEDEF Length pat_Tree guard_Tree rhs_Tree
ImplicitArg = IMPLICITARG Length arg_Tree
- Template = TEMPLATE Length parent_Tree* SelfDef? Stat*
-// if there is a primary constructor, it is the first statement in Stat*..
+ Template = TEMPLATE Length parent_Tree* SelfDef? Stat* // Stat* always starts with the primary constructor.
SelfDef = Param
ASTRef = Nat // byte position in AST payload
@@ -174,6 +173,7 @@ Standard-Section: "ASTs" Tree*
SCALA2X // Imported from Scala2.x
DEFAULTparameterized // Method with default params
DEFAULTinit // variable with “_” initializer
+ INSUPERCALL // defined the argument of a constructor supercall
annotation_Term
Note: Tree tags are grouped into 4 categories that determine what follows, and thus allow to compute the size of the tagged tree in a generic way.
@@ -243,6 +243,7 @@ object PickleFormat {
final val SCALA2X = 31
final val DEFAULTparameterized = 32
final val DEFAULTinit = 33
+ final val INSUPERCALL = 34
final val SHARED = 64
final val TERMREFdirect = 65
@@ -372,6 +373,7 @@ object PickleFormat {
case SCALA2X => "SCALA2X"
case DEFAULTparameterized => "DEFAULTparameterized"
case DEFAULTinit => "DEFAULTinit"
+ case INSUPERCALL => "INSUPERCALL"
case SHARED => "SHARED"
case TERMREFdirect => "TERMREFdirect"