File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
src/dotty/tools/dotc/printing Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -536,9 +536,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
536536 protected def literalText (text : Text ): Text = coloredText(text, SyntaxHighlighting .LiteralColor )
537537 protected def stringText (text : Text ): Text = coloredText(text, SyntaxHighlighting .StringColor )
538538
539- private def coloredStr (text : String , color : String ): String =
539+ protected def coloredStr (text : String , color : String ): String =
540540 if (ctx.useColors) color + text + SyntaxHighlighting .NoColor else text
541- private def coloredText (text : Text , color : String ): Text =
541+ protected def coloredText (text : Text , color : String ): Text =
542542 if (ctx.useColors) color ~ text ~ SyntaxHighlighting .NoColor else text
543543}
544544
Original file line number Diff line number Diff line change @@ -37,4 +37,9 @@ class ReplPrinter(_ctx: Context) extends DecompilerPrinter(_ctx) {
3737 else " :" ~~ toText(sym.info)
3838 }
3939 }
40+
41+ // We don't want the colors coming from RefinedPrinter as the REPL uses its
42+ // own syntax coloring mechanism.
43+ override def coloredStr (text : String , color : String ): String = text
44+ override def coloredText (text : Text , color : String ): Text = text
4045}
Original file line number Diff line number Diff line change 1+ scala> def fun[T](x: T): implicit List[T] => Int = ???
2+ def fun[T](x: T): implicit List[T] => Int
You can’t perform that action at this time.
0 commit comments