@@ -89,24 +89,23 @@ class Driver {
89
89
// Resolve classpath and class names of tasty files
90
90
val (classPaths, classNames) = fileNames0.flatMap { name =>
91
91
val path = Paths .get(name)
92
- if (name.endsWith(" .jar" ))
92
+ if ! name.endsWith(" .jar" ) && ! name.endsWith(" .tasty" ) then // is class name
93
+ (" " , name) :: Nil // TODO remove this case. We cannot rely on an expected tasty file beeing loaded.
94
+ else if ! Files .exists(path) then
95
+ report.error(s " File does not exist: $name" )
96
+ Nil
97
+ else if name.endsWith(" .jar" ) then
93
98
new dotty.tools.io.Jar (File (name)).toList.collect {
94
99
case e if e.getName.endsWith(" .tasty" ) =>
95
100
(name, e.getName.stripSuffix(" .tasty" ).replace(" /" , " ." ))
96
101
}
97
- else if (! name.endsWith(" .tasty" ))
98
- (" " , name) :: Nil
99
- else if (Files .exists(path))
100
- TastyFileUtil .getClassName(path) match {
101
- case Some (res) => res:: Nil
102
+ else
103
+ assert(name.endsWith(" .tasty" ))
104
+ TastyFileUtil .getClassName(path) match
105
+ case Some (res) => res :: Nil
102
106
case _ =>
103
- report.error(s " Could not load classname from $name. " )
104
- (" " , name) :: Nil
105
- }
106
- else {
107
- report.error(s " File $name does not exist. " )
108
- (" " , name) :: Nil
109
- }
107
+ report.error(s " Could not load classname from: $name" )
108
+ Nil
110
109
}.unzip
111
110
val ctx1 = ctx0.fresh
112
111
val classPaths1 = classPaths.distinct.filter(_ != " " )
0 commit comments