diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala index fdced5f83953..62955dcb72a7 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala @@ -313,6 +313,8 @@ private class ExtractDependenciesCollector extends tpd.TreeTraverser { thisTreeT private def ignoreDependency(sym: Symbol)(implicit ctx: Context) = !sym.exists || + sym.unforcedIsAbsent || // ignore dependencies that have a symbol but do not exist. + // e.g. java.lang.Object companion object sym.is(PackageClass) || sym.isEffectiveRoot || sym.isAnonymousFunction || diff --git a/tests/pos/i4318.scala b/tests/pos/i4318.scala new file mode 100644 index 000000000000..ebb777c5e1ff --- /dev/null +++ b/tests/pos/i4318.scala @@ -0,0 +1 @@ +import java.lang.Object