Skip to content

Commit

Permalink
add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha committed Aug 2, 2023
1 parent ea75836 commit 91e2b7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -475,18 +475,19 @@ class DependencyRecorder {
}
}

val depFile = dep.toClass.associatedFile
val depClass = dep.toClass
val depFile = depClass.associatedFile
if depFile != null then {
// Cannot ignore inheritance relationship coming from the same source (see sbt/zinc#417)
def allowLocal = dep.context == DependencyByInheritance || dep.context == LocalDependencyByInheritance
if depFile.hasTastyExtension then
processExternalDependency(depFile, dep.toClass.binaryClassName, convertTasty = true)
processExternalDependency(depFile, depClass.binaryClassName, convertTasty = true)
else if depFile.hasClassExtension then
processExternalDependency(depFile, dep.toClass.binaryClassName, convertTasty = false)
processExternalDependency(depFile, depClass.binaryClassName, convertTasty = false)
else if allowLocal || depFile != sourceFile.file then
// 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.toClass)
val toClassName = classNameAsString(depClass)
cb.classDependency(toClassName, fromClassName, dep.context)
}
}
Expand Down
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/io/AbstractFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ abstract class AbstractFile extends Iterable[AbstractFile] {
/** Returns the path of this abstract file in a canonical form. */
def canonicalPath: String = if (jpath == null) path else jpath.normalize.toString

/** Checks extension case insensitively. */
/** Checks extension case insensitively. TODO: change to enum */
def hasExtension(other: String): Boolean = extension == other.toLowerCase

/** Returns the extension of this abstract file. TODO: store as an enum to avoid costly comparisons */
val extension: String = Path.extension(name)

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

0 comments on commit 91e2b7e

Please sign in to comment.