File tree 2 files changed +6
-6
lines changed
compiler/src/dotty/tools/dotc
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -90,23 +90,23 @@ class Driver {
90
90
// Resolve classpath and class names of tasty files
91
91
val (classPaths, classNames) = fileNames0.flatMap { name =>
92
92
val path = Paths .get(name)
93
- if ! name.endsWith(" .jar" ) && ! name.endsWith(" .tasty" ) then // is class name
94
- (" " , name) :: Nil // TODO remove this case. We cannot rely on an expected tasty file beeing loaded.
95
- else if ! Files .exists(path) then
93
+ if ! Files .exists(path) then
96
94
report.error(s " File does not exist: $name" )
97
95
Nil
98
96
else if name.endsWith(" .jar" ) then
99
97
new dotty.tools.io.Jar (File (name)).toList.collect {
100
98
case e if e.getName.endsWith(" .tasty" ) && ! fromTastyIgnoreList(e.getName) =>
101
99
(name, e.getName.stripSuffix(" .tasty" ).replace(" /" , " ." ))
102
100
}
103
- else
104
- assert(name.endsWith(" .tasty" ))
101
+ else if name.endsWith(" .tasty" ) then
105
102
TastyFileUtil .getClassName(path) match
106
103
case Some (res) => res :: Nil
107
104
case _ =>
108
105
report.error(s " Could not load classname from: $name" )
109
106
Nil
107
+ else
108
+ report.error(s " File extension is not `tasty` or `jar`: $name" )
109
+ Nil
110
110
}.unzip
111
111
val ctx1 = ctx0.fresh
112
112
val classPaths1 = classPaths.distinct.filter(_ != " " )
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ grep -qe "$EXPECTED_OUTPUT" "$tmp"
10
10
# check that `sbt scalac` compiles and `sbt scala` runs it
11
11
echo " testing sbt scalac -from-tasty and scala -classpath"
12
12
clear_out " $OUT "
13
- " $SBT " " ;scalac $SOURCE -d $OUT ;scalac -from-tasty -classpath $OUT - d $OUT1 $MAIN ;scala -classpath $OUT1 $MAIN " > " $tmp "
13
+ " $SBT " " ;scalac $SOURCE -d $OUT ;scalac -from-tasty -d $OUT1 $OUT / $TASTY ;scala -classpath $OUT1 $MAIN " > " $tmp "
14
14
grep -qe " $EXPECTED_OUTPUT " " $tmp "
15
15
16
16
echo " testing sbt scalac -from-tasty from a jar and scala -classpath"
You can’t perform that action at this time.
0 commit comments