File tree 1 file changed +5
-5
lines changed
compiler/src/dotty/tools/dotc
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -89,23 +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" ) && ! 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
92
+ if ! Files .exists(path) then
95
93
report.error(s " File does not exist: $name" )
96
94
Nil
97
95
else if name.endsWith(" .jar" ) then
98
96
new dotty.tools.io.Jar (File (name)).toList.collect {
99
97
case e if e.getName.endsWith(" .tasty" ) =>
100
98
(name, e.getName.stripSuffix(" .tasty" ).replace(" /" , " ." ))
101
99
}
102
- else
103
- assert(name.endsWith(" .tasty" ))
100
+ else if name.endsWith(" .tasty" ) then
104
101
TastyFileUtil .getClassName(path) match
105
102
case Some (res) => res :: Nil
106
103
case _ =>
107
104
report.error(s " Could not load classname from: $name" )
108
105
Nil
106
+ else
107
+ report.error(s " File extension is not `tasty` or `jar`: $name" )
108
+ Nil
109
109
}.unzip
110
110
val ctx1 = ctx0.fresh
111
111
val classPaths1 = classPaths.distinct.filter(_ != " " )
You can’t perform that action at this time.
0 commit comments