From 246dfc4ac58d8afaf14010788e97f736baecc596 Mon Sep 17 00:00:00 2001 From: Jamie Thompson Date: Mon, 17 Jul 2023 16:52:43 +0200 Subject: [PATCH] simplify file comparison --- compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala index 70e6b8660999..661781e08ea8 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala @@ -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 = @@ -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)