Skip to content

Commit 91e2b7e

Browse files
committed
add todo
1 parent ea75836 commit 91e2b7e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,18 +475,19 @@ class DependencyRecorder {
475475
}
476476
}
477477

478-
val depFile = dep.toClass.associatedFile
478+
val depClass = dep.toClass
479+
val depFile = depClass.associatedFile
479480
if depFile != null then {
480481
// Cannot ignore inheritance relationship coming from the same source (see sbt/zinc#417)
481482
def allowLocal = dep.context == DependencyByInheritance || dep.context == LocalDependencyByInheritance
482483
if depFile.hasTastyExtension then
483-
processExternalDependency(depFile, dep.toClass.binaryClassName, convertTasty = true)
484+
processExternalDependency(depFile, depClass.binaryClassName, convertTasty = true)
484485
else if depFile.hasClassExtension then
485-
processExternalDependency(depFile, dep.toClass.binaryClassName, convertTasty = false)
486+
processExternalDependency(depFile, depClass.binaryClassName, convertTasty = false)
486487
else if allowLocal || depFile != sourceFile.file then
487488
// We cannot ignore dependencies coming from the same source file because
488489
// the dependency info needs to propagate. See source-dependencies/trait-trait-211.
489-
val toClassName = classNameAsString(dep.toClass)
490+
val toClassName = classNameAsString(depClass)
490491
cb.classDependency(toClassName, fromClassName, dep.context)
491492
}
492493
}

compiler/src/dotty/tools/io/AbstractFile.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ abstract class AbstractFile extends Iterable[AbstractFile] {
9797
/** Returns the path of this abstract file in a canonical form. */
9898
def canonicalPath: String = if (jpath == null) path else jpath.normalize.toString
9999

100-
/** Checks extension case insensitively. */
100+
/** Checks extension case insensitively. TODO: change to enum */
101101
def hasExtension(other: String): Boolean = extension == other.toLowerCase
102+
103+
/** Returns the extension of this abstract file. TODO: store as an enum to avoid costly comparisons */
102104
val extension: String = Path.extension(name)
103105

104106
/** The absolute file, if this is a relative file. */

0 commit comments

Comments
 (0)