File tree Expand file tree Collapse file tree 6 files changed +17
-4
lines changed
src/dotty/tools/dotc/printing Expand file tree Collapse file tree 6 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
169169 " <noprefix>"
170170 case tp : MethodType =>
171171 changePrec(GlobalPrec ) {
172- (if (tp.isImplicitMethod) " (implicit " else " (" ) ~ paramsText(tp) ~
172+ (" (" + (if (tp.isErasedMethod) " erased " else " " )
173+ + (if (tp.isImplicitMethod) " implicit " else " " )
174+ ) ~ paramsText(tp) ~
173175 (if (tp.resultType.isInstanceOf [MethodType ]) " )" else " ): " ) ~
174176 toText(tp.resultType)
175177 }
@@ -536,9 +538,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
536538 protected def literalText (text : Text ): Text = coloredText(text, SyntaxHighlighting .LiteralColor )
537539 protected def stringText (text : Text ): Text = coloredText(text, SyntaxHighlighting .StringColor )
538540
539- private def coloredStr (text : String , color : String ): String =
541+ protected def coloredStr (text : String , color : String ): String =
540542 if (ctx.useColors) color + text + SyntaxHighlighting .NoColor else text
541- private def coloredText (text : Text , color : String ): Text =
543+ protected def coloredText (text : Text , color : String ): Text =
542544 if (ctx.useColors) color ~ text ~ SyntaxHighlighting .NoColor else text
543545}
544546
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 @@ -31,7 +31,7 @@ object SyntaxHighlighting {
3131 private val tripleQs = Console .RED_B + " ???" + NoColor
3232
3333 private val keywords : Seq [String ] = for {
34- index <- IF to ENUM // All alpha keywords
34+ index <- IF to ERASED // All alpha keywords
3535 } yield tokenString(index)
3636
3737 private val interpolationPrefixes =
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
Original file line number Diff line number Diff line change 1+ scala> def f(erased a: Int): Int = ???
2+ def f(erased a: Int): Int
Original file line number Diff line number Diff line change 1+ scala> def f(erased implicit a: Int): Int = ???
2+ def f(erased implicit a: Int): Int
You can’t perform that action at this time.
0 commit comments