diff options
Diffstat (limited to 'compiler/src/dotty/tools/io/ClassPath.scala')
-rw-r--r-- | compiler/src/dotty/tools/io/ClassPath.scala | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/compiler/src/dotty/tools/io/ClassPath.scala b/compiler/src/dotty/tools/io/ClassPath.scala index 3afbed838..5e77c1b61 100644 --- a/compiler/src/dotty/tools/io/ClassPath.scala +++ b/compiler/src/dotty/tools/io/ClassPath.scala @@ -240,22 +240,16 @@ abstract class ClassPath { def findClass(name: String): Option[AnyClassRep] = name.splitWhere(_ == '.', doDropIndex = true) match { case Some((pkg, rest)) => - val rep = packages find (_.name == pkg) flatMap (_ findClass rest) - rep map { - case x: ClassRep => x - case x => throw new FatalError("Unexpected ClassRep '%s' found searching for name '%s'".format(x, name)) - } + packages find (_.name == pkg) flatMap (_ findClass rest) case _ => classes find (_.name == name) } - def findSourceFile(name: String): Option[AbstractFile] = - findClass(name) match { - case Some(ClassRep(Some(x: AbstractFile), _)) => Some(x) - case _ => None - } + def findBinaryFile(name: String): Option[AbstractFile] = + findClass(name).flatMap(_.binary) def sortString = join(split(asClasspathString).sorted: _*) + override def equals(that: Any) = that match { case x: ClassPath => this.sortString == x.sortString case _ => false |