Skip to content

Commit f53e8f9

Browse files
committed
simplify file comparison
[Cherry-picked 246dfc4][modified]
1 parent 46a2792 commit f53e8f9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,12 @@ class ExtractDependencies extends Phase {
138138

139139
val depFile = dep.to.associatedFile
140140
if (depFile != null) {
141-
def depIsSameSource =
142-
depFile.absolutePath == sourceFile.file.absolutePath
143-
144141
// Cannot ignore inheritance relationship coming from the same source (see sbt/zinc#417)
145142
def allowLocal = dep.context == DependencyByInheritance || dep.context == LocalDependencyByInheritance
146143
if (depFile.extension == "class") {
147144
// Dependency is external -- source is undefined
148145
processExternalDependency(depFile, dep.to.binaryClassName)
149-
else if (allowLocal || !depIsSameSource /* old: depFile.file != sourceFile.file */) {
146+
} else if (allowLocal || depFile != sourceFile.file) {
150147
// We cannot ignore dependencies coming from the same source file because
151148
// the dependency info needs to propagate. See source-dependencies/trait-trait-211.
152149
val toClassName = classNameAsString(dep.to)

0 commit comments

Comments
 (0)