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