Skip to content

Commit 64b0dc0

Browse files
committed
Tweaks to pickling and unpickling untyped trees
- need to maintain Type mode bit for correct desugaring - need to pickle PatDefs directly since desugaring requires too much context.
1 parent c8c0aab commit 64b0dc0

File tree

3 files changed

+217
-191
lines changed

3 files changed

+217
-191
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Standard-Section: "ASTs" TopLevelStat*
5959
DEFDEF Length NameRef TypeParam* Params* returnType_Term rhs_Term?
6060
Modifier*
6161
TYPEDEF Length NameRef (type_Term | Template) Modifier*
62-
OBJECTDEF Length NameRef Template Mods
62+
OBJECTDEF Length NameRef Template Modifier*
6363
IMPORT Length qual_Term Selector*
6464
Selector = IMPORTED name_NameRef
6565
RENAMED to_NameRef
@@ -208,9 +208,10 @@ Standard-Section: "ASTs" TopLevelStat*
208208
// --------------- untyped additions ------------------------------------------
209209
210210
TermUntyped = Term
211+
TYPEDSPLICE Length splice_Term
211212
FUNCTION Length body_Term arg_Term*
212213
INFIXOP Length op_NameRef left_Term right_Term
213-
TYPEDSPLICE Length splice_Term
214+
PATDEF Length type_Term rhs_Term pattern_Term* Modifier*
214215
215216
Note: Tree tags are grouped into 5 categories that determine what follows, and thus allow to compute the size of the tagged tree in a generic way.
216217
@@ -427,6 +428,7 @@ object TastyFormat {
427428
final val TYPEDSPLICE = 200
428429
final val FUNCTION = 201
429430
final val INFIXOP = 202
431+
final val PATDEF = 203
430432

431433
def methodType(isImplicit: Boolean = false, isErased: Boolean = false) = {
432434
val implicitOffset = if (isImplicit) 1 else 0
@@ -644,6 +646,7 @@ object TastyFormat {
644646
case TYPEDSPLICE => "TYPEDSPLICE"
645647
case FUNCTION => "FUNCTION"
646648
case INFIXOP => "INFIXOP"
649+
case PATDEF => "PATDEF"
647650
}
648651

649652
/** @return If non-negative, the number of leading references (represented as nats) of a length/trees entry.

0 commit comments

Comments
 (0)