diff --git a/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala b/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala index 895b8c4f9318..e7f432107829 100644 --- a/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala +++ b/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala @@ -119,10 +119,14 @@ class InteractiveDriver(val settings: List[String]) extends Driver { private val (zipClassPaths, dirClassPaths) = currentCtx.platform.classPath(currentCtx) match { case AggregateClassPath(cps) => - val (zipCps, dirCps) = cps.partition(_.isInstanceOf[ZipArchiveFileLookup[_]]) - // This will be wrong if any other subclass of ClassPath is either used, - // like `JrtClassPath` once we get Java 9 support - (zipCps.asInstanceOf[Seq[ZipArchiveFileLookup[_]]], dirCps.asInstanceOf[Seq[JFileDirectoryLookup[_]]]) + // FIXME: We shouldn't assume that ClassPath doesn't have other + // subclasses. For now, the only other subclass is JrtClassPath on Java + // 9+, we can safely ignore it for now because it's only used for the + // standard Java library, but this will change once we start supporting + // adding entries to the modulepath. + val zipCps = cps.collect { case cp: ZipArchiveFileLookup[_] => cp } + val dirCps = cps.collect { case cp: JFileDirectoryLookup[_] => cp } + (zipCps, dirCps) case _ => (Seq(), Seq()) }