Skip to content

Commit

Permalink
simplify file comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha committed Jul 17, 2023
1 parent aa27580 commit 246dfc4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ class ExtractDependencies extends Phase {

val depFile = dep.to.associatedFile
if (depFile != null) {
def depIsSameSource =
depFile.absolutePath == sourceFile.file.absolutePath

// Cannot ignore inheritance relationship coming from the same source (see sbt/zinc#417)
def allowLocal = dep.context == DependencyByInheritance || dep.context == LocalDependencyByInheritance
val depClassFile =
Expand All @@ -150,7 +147,7 @@ class ExtractDependencies extends Phase {
if (depClassFile != null) {
// Dependency is external -- source is undefined
processExternalDependency(depClassFile, dep.to.binaryClassName)
} else if (allowLocal || !depIsSameSource /* old: depFile.file != sourceFile.file */) {
} else if (allowLocal || depFile != sourceFile.file) {
// We cannot ignore dependencies coming from the same source file because
// the dependency info needs to propagate. See source-dependencies/trait-trait-211.
val toClassName = classNameAsString(dep.to)
Expand Down

0 comments on commit 246dfc4

Please sign in to comment.