File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/core/tasty Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -112,9 +112,16 @@ class TreeUnpickler(reader: TastyReader,
112
112
val owner = ctx.owner
113
113
val source = ctx.source
114
114
def complete (denot : SymDenotation )(implicit ctx : Context ): Unit = {
115
+ val sourceToUse = if (source.exists) source else ctx.source
116
+ // TODO: remove. This is a hack to get pickling tests (notable tuple-cons-2.scala
117
+ // to pass. The problem is that without a bootstrapped library some unpicked
118
+ // files are lacking a source, and if these are completed from Definitions
119
+ // there's also no external source given in `context`. In that case we switch
120
+ // late and pick the calling context's source. We can drop this hack once
121
+ // all Tasty trees have a SOURCE entry, which will determine the context source
115
122
treeAtAddr(currentAddr) =
116
123
new TreeReader (reader).readIndexedDef()(
117
- ctx.withPhaseNoLater(ctx.picklerPhase).withOwner(owner).withSource(source ))
124
+ ctx.withPhaseNoLater(ctx.picklerPhase).withOwner(owner).withSource(sourceToUse ))
118
125
}
119
126
}
120
127
You can’t perform that action at this time.
0 commit comments