Skip to content

Commit adf7e3f

Browse files
committed
Use source file from TASTy attribute when available
1 parent a34d8d6 commit adf7e3f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/src/dotty/tools/dotc/core/Symbols.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,12 @@ object Symbols extends SymUtils {
486486
mySource = ctx.getSource(file)
487487
else
488488
mySource = defn.patchSource(this)
489+
if !mySource.exists then
490+
val compUnitInfo = compilationUnitInfo
491+
if compUnitInfo != null then
492+
compUnitInfo.tastyInfo.flatMap(_.attributes.sourceFile) match
493+
case Some(path) => mySource = ctx.getSource(path)
494+
case _ =>
489495
if !mySource.exists then
490496
mySource = atPhaseNoLater(flattenPhase) {
491497
denot.topLevelClass.unforcedAnnotation(defn.SourceFileAnnot) match

0 commit comments

Comments
 (0)