@@ -7,7 +7,7 @@ import java.io.File
7
7
import java .util .{Arrays , EnumSet }
8
8
9
9
import dotty .tools .dotc .ast .tpd
10
- import dotty .tools .dotc .classpath .FileUtils .{isTasty , isClass }
10
+ import dotty .tools .dotc .classpath .FileUtils .{isTasty , isClassExtension , isTastyExtension }
11
11
import dotty .tools .dotc .core .Contexts ._
12
12
import dotty .tools .dotc .core .Decorators ._
13
13
import dotty .tools .dotc .core .Flags ._
@@ -142,13 +142,16 @@ class ExtractDependencies extends Phase {
142
142
if (depFile != null ) {
143
143
// Cannot ignore inheritance relationship coming from the same source (see sbt/zinc#417)
144
144
def allowLocal = dep.context == DependencyByInheritance || dep.context == LocalDependencyByInheritance
145
- val depClassFile =
146
- if depFile.isClass then depFile
147
- else depFile.resolveSibling(dep.to.binaryClassName + " .class" )
148
- if (depClassFile != null ) {
149
- // Dependency is external -- source is undefined
150
- processExternalDependency(depClassFile, dep.to.binaryClassName)
151
- } else if (allowLocal || depFile.file != sourceFile) {
145
+ if depFile.isTastyExtension then
146
+ val depClassFile = depFile.resolveSibling(depFile.name.stripSuffix(" .tasty" ) + " .class" )
147
+ if depClassFile != null then
148
+ // did not find associated class file, e.g. for a TASTy-only classpath.
149
+ // The file that Zinc recieves with binaryDependency is used to lookup any either any
150
+ // generated non-local classes or produced xsbti.API associated with the file.
151
+ processExternalDependency(depClassFile, dep.to.binaryClassName)
152
+ else if depFile.isClassExtension then
153
+ processExternalDependency(depFile, dep.to.binaryClassName)
154
+ else if (allowLocal || depFile.file != sourceFile) {
152
155
// We cannot ignore dependencies coming from the same source file because
153
156
// the dependency info needs to propagate. See source-dependencies/trait-trait-211.
154
157
val toClassName = classNameAsString(dep.to)
0 commit comments