File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
compiler/src/dotty/tools/dotc/fromtasty Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -37,19 +37,19 @@ object Debug {
37
37
val fromTastyOut = Files .createDirectory(tmpOut.resolve(" from-tasty" ))
38
38
39
39
val extensions = List (" tasty" , " hasTasty" ).map(_.toLowerCase)
40
- val classes = Directory (fromSourcesOut).walk.filter(x => x.isFile && extensions.exists(_ == x.extension.toLowerCase)).map { x =>
41
- val source = x.toString
42
- // transform foo/bar/Baz.hasTasty into foo.bar.Baz
43
- source.substring(fromSourcesOut.toString.length + 1 , source.length - x.extension.length - 1 ).replace( '/' , '.' )
44
- } .toList
40
+ val tastyFiles =
41
+ Directory (fromSourcesOut).walk
42
+ .filter(x => x.isFile && extensions.exists(_ == x.extension.toLowerCase))
43
+ .map(_.toString )
44
+ .toList
45
45
46
46
val fromTastyArgs =
47
47
" -from-tasty" ::
48
48
" -d" :: fromTastyOut.toString ::
49
49
insertClasspathInArgs(args.filterNot(_.endsWith(" .scala" )).toList, fromSourcesOut.toString) :::
50
- classes
50
+ tastyFiles
51
51
52
- println(" Compiling TASTY from .class sources" )
52
+ println(" Compiling from .tasty sources" )
53
53
val compilation2 = dotc.Main .process(fromTastyArgs.toArray)
54
54
55
55
if (compilation2.hasErrors) {
@@ -58,6 +58,8 @@ object Debug {
58
58
// In this case we do not delete the generated class files to allow further debugging.
59
59
// For example `dotc -decompile` on one of the intermediate class files.
60
60
sys.exit(1 )
61
+ } else {
62
+ println(" Recompilation successful" )
61
63
}
62
64
63
65
Directory (tmpOut).deleteRecursively()
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ rm $OUT/A.scala
48
48
" $SBT " " scalac -classpath $OUT1 -d $OUT1 $OUT /B.scala" > " $tmp " 2>&1 || echo " ok"
49
49
grep -qe " B.scala:2:7" " $tmp "
50
50
51
+ echo " testing -Ythrough-tasty"
52
+ clear_out " $OUT "
53
+ " $SBT " " ;scalac -Ythrough-tasty $SOURCE "
51
54
52
55
# # Disabled because of flakeyness, should be changed to not depend on sbt
53
56
# echo "running Vulpix meta test"
You can’t perform that action at this time.
0 commit comments