Skip to content

Commit ca883f6

Browse files
committed
Fix incremental compilation dependency tracking
Since #2191, `dotty.tools.dotc.io.PlainFile` is no longer an alias for `scala.reflect.io.PlainFile` but its own class. However, the backend still uses PlainFile from scala.reflect. This mess should soon be fixed by getting rid of scala-reflect (#2271). Meanwhile, this commit fixes ExtractDependencies to pattern match on the correct class, and thus avoid missing dependencies.
1 parent f1c3529 commit ca883f6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Names._, NameOps._, StdNames._
88

99
import scala.collection.{Set, mutable}
1010

11-
import dotty.tools.io.{AbstractFile, Path, PlainFile, ZipArchive}
11+
import dotty.tools.io.{AbstractFile, Path, ZipArchive}
1212
import java.io.File
1313

1414
import java.util.{Arrays, Comparator}
@@ -101,14 +101,15 @@ class ExtractDependencies extends Phase {
101101
val classSegments = Path(ze.path).segments
102102
binaryDependency(zipFile, className(classSegments))
103103
}
104-
case pf: PlainFile =>
104+
case pf: scala.reflect.io.PlainFile =>
105105
val packages = dep.ownersIterator
106106
.filter(x => x.is(PackageClass) && !x.isEffectiveRoot).length
107107
// We can recover the fully qualified name of a classfile from
108108
// its path
109109
val classSegments = pf.givenPath.segments.takeRight(packages + 1)
110110
binaryDependency(pf.file, className(classSegments))
111111
case _ =>
112+
ctx.warning(s"sbt-deps: Ignoring dependency $depFile of class ${depFile.getClass}")
112113
}
113114
} else if (depFile.file != currentSourceFile) {
114115
ctx.sbtCallback.sourceDependency(depFile.file, currentSourceFile, context)

0 commit comments

Comments
 (0)