Skip to content

Commit 1f63256

Browse files
authored
Merge pull request #5415 from dotty-staging/fix-#5414
Fix #5414: Always emit / for path in decompilation comment
2 parents 45eb6aa + 10ad94b commit 1f63256

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)