Skip to content

Commit 652b570

Browse files
committed
Drop unnecessary compatibility hack
... and bump major Tasty version Also: drop unused method
1 parent 8d3b7ef commit 652b570

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,6 @@ object Trees {
978978
protected def finalize(tree: Tree, copied: untpd.MemberDef): copied.ThisTree[T] =
979979
postProcess(tree, copied.withSpan(tree.span).withAttachmentsFrom(tree))
980980

981-
protected def srcCtx(tree: Tree)(implicit ctx: Context) = ctx.withSource(tree.source)
982-
983981
def Ident(tree: Tree)(name: Name)(implicit ctx: Context): Ident = tree match {
984982
case tree: BackquotedIdent =>
985983
if (name == tree.name) tree

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)