Skip to content

Commit 79e2228

Browse files
oderskyDarkDimius
authored andcommitted
Change to PickleFormat
Remove 3rd argument of BIND types. It can be reconstructed on unpickling.
1 parent 8c6339b commit 79e2228

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
409409
override def Select(tree: Tree)(qualifier: Tree, name: Name)(implicit ctx: Context): Select = {
410410
val tree1 = untpd.cpy.Select(tree)(qualifier, name)
411411
tree match {
412-
case tree: Select if (qualifier.tpe eq tree.qualifier.tpe) => tree1.withTypeUnchecked(tree.tpe)
412+
case tree: Select if (qualifier.tpe eq tree.qualifier.tpe) =>
413+
tree1.withTypeUnchecked(tree.tpe)
413414
case _ => tree.tpe match {
414415
case tpe: NamedType => tree1.withType(tpe.derivedSelect(qualifier.tpe))
415416
case _ => tree1.withTypeUnchecked(tree.tpe)

src/dotty/tools/dotc/core/pickling/PickleFormat.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,8 @@ Standard-Section: "ASTs" TopLevelStat*
135135
ANNOTATED Length fullAnnotation_Term underlying_Type
136136
ANDtype Length left_Type right_Type
137137
ORtype Length left_Type right_Type
138-
BIND Length boundName_NameRef bounds_Type selfRef_Type
138+
BIND Length boundName_NameRef bounds_Type
139139
// for type-variables defined in a type pattern
140-
// bounds = type bounds, selfRef = reference to type itself.
141140
BYNAMEtype underlying_Type
142141
POLYtype Length result_Type NamesTypes // needed for refinements
143142
METHODtype Length result_Type NamesTypes // needed for refinements

src/dotty/tools/dotc/core/pickling/TreePickler.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ class TreePickler(pickler: TastyPickler) {
250250
pickleType(tpe.ref)
251251
case NoType =>
252252
writeByte(NOTYPE)
253-
// case NoPrefix => // not sure we need this!
254-
// writeByte(NOPREFIX)
255253
}} catch {
256254
case ex: AssertionError =>
257255
println(i"error while pickling type $tpe")

src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) {
201201
case ORtype =>
202202
OrType(readType(), readType())
203203
case BIND =>
204-
symAtAddr(start) =
205-
ctx.newSymbol(ctx.owner, readName().toTypeName, BindDefinedType, readType())
206-
readType()
204+
val sym = ctx.newSymbol(ctx.owner, readName().toTypeName, BindDefinedType, readType())
205+
symAtAddr(start) = sym
206+
TypeRef.withFixedSym(NoPrefix, sym.name, sym)
207207
case POLYtype =>
208208
val (names, paramReader) = readNamesSkipParams[TypeName]
209209
val result = PolyType(names)(

0 commit comments

Comments
 (0)