Skip to content

Commit

Permalink
Don't initialize symbols before finding classfile
Browse files Browse the repository at this point in the history
Previously, we would complete symbols before trying to find the
associated classfile. This is problematic for symbols where we don't
have the classfile (for instance, when compiling with Pants'
`strict_deps` enabled).

This initialization was introduced in #758, to workaround a scalac bug
where the associated classfile of a symbol wouldn't be set before the
symbol is completed. This bug has been fixed in Scala 2.12.12 and later
(see scala/scalac#8889).

Fixes #949
  • Loading branch information
Duhemm authored and eed3si9n committed Nov 30, 2020
1 parent 757a0ea commit d27f5fa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ final class Dependency(val global: CallbackGlobal) extends LocateClassFile with
isSyntheticCoreClass(targetSymbol)
)
if (!noByteCode) {
classFile(targetSymbol.initialize) match {
classFile(targetSymbol) match {
case Some((at, binaryClassName)) =>
// Associated file is set, so we know which classpath entry it came from
processExternalDependency(binaryClassName, at)
Expand Down

0 comments on commit d27f5fa

Please sign in to comment.