Skip to content

Commit 005ff4e

Browse files
committed
Drop redundant compatibility hack
Drop backwards compatibility hack in TreeUnpickler, which is no longer needed. Bump Tasty major version.
1 parent 8d3b7ef commit 005ff4e

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Standard Section: "Comments" Comment*
244244
object TastyFormat {
245245

246246
final val header: Array[Int] = Array(0x5C, 0xA1, 0xAB, 0x1F)
247-
val MajorVersion: Int = 11
247+
val MajorVersion: Int = 12
248248
val MinorVersion: Int = 0
249249

250250
/** Tags used to serialize names */

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,9 @@ class TreeUnpickler(reader: TastyReader,
111111
val owner = ctx.owner
112112
val source = ctx.source
113113
def complete(denot: SymDenotation)(implicit ctx: Context): Unit = {
114-
val sourceToUse = if (source.exists) source else ctx.source
115-
// TODO: remove. This is a hack to get pickling tests (notable tuple-cons-2.scala
116-
// to pass. The problem is that without a bootstrapped library some unpicked
117-
// files are lacking a source, and if these are completed from Definitions
118-
// there's also no external source given in `context`. In that case we switch
119-
// late and pick the calling context's source. We can drop this hack once
120-
// all Tasty trees have a SOURCE entry, which will determine the context source
121114
treeAtAddr(currentAddr) =
122115
new TreeReader(reader).readIndexedDef()(
123-
ctx.withPhaseNoLater(ctx.picklerPhase).withOwner(owner).withSource(sourceToUse))
116+
ctx.withPhaseNoLater(ctx.picklerPhase).withOwner(owner).withSource(source))
124117
}
125118
}
126119

0 commit comments

Comments
 (0)