Skip to content

Commit 10ad94b

Browse files
committed
Fix #5414: Always emit / for path in decompilation comment
Also fix the extension of the file
1 parent 45eb6aa commit 10ad94b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ class DecompilationPrinter extends Phase {
3939
if (ctx.settings.printTasty.value) {
4040
new TastyPrinter(unit.pickled.head._2).printContents()
4141
} else {
42-
out.println(s"/** Decompiled from $unit */")
42+
val unitFile = unit.source.toString.replace("\\", "/").replace(".class", ".tasty")
43+
out.println(s"/** Decompiled from $unitFile */")
4344
out.println(new TastyImpl(ctx).showSourceCode.showTree(unit.tpdTree)(ctx))
4445
}
4546
}

0 commit comments

Comments
 (0)