Skip to content

Commit bb60d3c

Browse files
committed
Turn cleaning on for interpreter generated messages
Avoids line$object... gunk.
1 parent 4f19388 commit bb60d3c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/dotty/tools/dotc/repl/CompilingInterpreter.scala

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@ class CompilingInterpreter(out: PrintWriter, ictx: Context) extends Compiler wit
9393

9494
private def newReporter = new ConsoleReporter(Console.in, out) {
9595
override def printMessage(msg: String) = {
96-
out.print(clean(msg) + "\n")
96+
out.print(/*clean*/(msg) + "\n")
97+
// Suppress clean for now for compiler messages
98+
// Otherwise we will completely delete all references to
99+
// line$object$ module classes. The previous interpreter did not
100+
// have the project because the module class was written without the final `$'
101+
// and therefore escaped the purge. We can turn this back on once
102+
// we drop the final `$' from module classes.
97103
out.flush()
98104
}
99105
}
@@ -752,8 +758,8 @@ class CompilingInterpreter(out: PrintWriter, ictx: Context) extends Compiler wit
752758
}
753759

754760
/** Clean up a string for output */
755-
private def clean(str: String) = str
756-
// truncPrintString(stripWrapperGunk(str)) // TODO: enable
761+
private def clean(str: String) =
762+
truncPrintString(stripWrapperGunk(str))
757763

758764
/** Indent some code by the width of the scala> prompt.
759765
* This way, compiler error messages read better.

0 commit comments

Comments
 (0)