Skip to content

Commit 4b1385e

Browse files
committed
Improve messages
1 parent d992f6c commit 4b1385e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/src/dotty/tools/dotc/fromtasty/Debug.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ object Debug {
2424

2525
val fromSourcesOut = Files.createDirectory(tmpOut.resolve("from-source"))
2626

27-
println(s"Compiling .scala")
27+
println("Compiling from .scala sources")
2828
val compilation1 = dotc.Main.process("-d" +: fromSourcesOut.toString +: args)
2929

3030
if (compilation1.hasErrors) {
3131
println("Failed compilation from sources")
32+
Directory(tmpOut).deleteRecursively()
3233
sys.exit(1)
3334
}
3435

@@ -37,6 +38,7 @@ object Debug {
3738
val ext = "hasTasty"
3839
val classes = Directory(fromSourcesOut).walk.filter(x => x.isFile && x.extension == ext).map { x =>
3940
val source = x.toString
41+
// transform foo/bar/Baz.hasTasty into foo.bar.Baz
4042
source.substring(fromSourcesOut.toString.length + 1, source.length - ext.length - 1).replace('/', '.')
4143
}.toList
4244

@@ -47,12 +49,14 @@ object Debug {
4749
classes
4850
}
4951

50-
println(s"Compiling TASTY")
52+
println("Compiling TASTY from .class sources")
5153
val compilation2 = dotc.Main.process(fromTastyArgs.toArray)
5254

5355
if (compilation2.hasErrors) {
5456
println("Failed compilation from TASTY")
5557
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.
5660
sys.exit(1)
5761
}
5862

0 commit comments

Comments
 (0)