From 10ad94be2123685c84cb558b96e1ad83c8b1c6c0 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 8 Nov 2018 18:35:00 +0000 Subject: [PATCH] Fix #5414: Always emit / for path in decompilation comment Also fix the extension of the file --- .../src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala b/compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala index 6bed8e30c2df..741a448098ab 100644 --- a/compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala +++ b/compiler/src/dotty/tools/dotc/decompiler/DecompilationPrinter.scala @@ -39,7 +39,8 @@ class DecompilationPrinter extends Phase { if (ctx.settings.printTasty.value) { new TastyPrinter(unit.pickled.head._2).printContents() } else { - out.println(s"/** Decompiled from $unit */") + val unitFile = unit.source.toString.replace("\\", "/").replace(".class", ".tasty") + out.println(s"/** Decompiled from $unitFile */") out.println(new TastyImpl(ctx).showSourceCode.showTree(unit.tpdTree)(ctx)) } }