File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
compiler/src/dotty/tools/dotc/fromtasty Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,12 @@ object Debug {
24
24
25
25
val fromSourcesOut = Files .createDirectory(tmpOut.resolve(" from-source" ))
26
26
27
- println(s " Compiling .scala " )
27
+ println(" Compiling from .scala sources " )
28
28
val compilation1 = dotc.Main .process(" -d" +: fromSourcesOut.toString +: args)
29
29
30
30
if (compilation1.hasErrors) {
31
31
println(" Failed compilation from sources" )
32
+ Directory (tmpOut).deleteRecursively()
32
33
sys.exit(1 )
33
34
}
34
35
@@ -37,6 +38,7 @@ object Debug {
37
38
val ext = " hasTasty"
38
39
val classes = Directory (fromSourcesOut).walk.filter(x => x.isFile && x.extension == ext).map { x =>
39
40
val source = x.toString
41
+ // transform foo/bar/Baz.hasTasty into foo.bar.Baz
40
42
source.substring(fromSourcesOut.toString.length + 1 , source.length - ext.length - 1 ).replace('/' , '.' )
41
43
}.toList
42
44
@@ -47,12 +49,14 @@ object Debug {
47
49
classes
48
50
}
49
51
50
- println(s " Compiling TASTY " )
52
+ println(" Compiling TASTY from .class sources " )
51
53
val compilation2 = dotc.Main .process(fromTastyArgs.toArray)
52
54
53
55
if (compilation2.hasErrors) {
54
56
println(" Failed compilation from TASTY" )
55
57
println(" Compilation input: " + fromSourcesOut)
58
+ // In this case we do not delete the generated class files to allow further debugging.
59
+ // For example `dotc -decompile` on one of the intermediate class files.
56
60
sys.exit(1 )
57
61
}
58
62
You can’t perform that action at this time.
0 commit comments