File tree 6 files changed +17
-4
lines changed
src/dotty/tools/dotc/printing
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 {
169
169
" <noprefix>"
170
170
case tp : MethodType =>
171
171
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) ~
173
175
(if (tp.resultType.isInstanceOf [MethodType ]) " )" else " ): " ) ~
174
176
toText(tp.resultType)
175
177
}
@@ -536,9 +538,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
536
538
protected def literalText (text : Text ): Text = coloredText(text, SyntaxHighlighting .LiteralColor )
537
539
protected def stringText (text : Text ): Text = coloredText(text, SyntaxHighlighting .StringColor )
538
540
539
- private def coloredStr (text : String , color : String ): String =
541
+ protected def coloredStr (text : String , color : String ): String =
540
542
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 =
542
544
if (ctx.useColors) color ~ text ~ SyntaxHighlighting .NoColor else text
543
545
}
544
546
Original file line number Diff line number Diff line change @@ -37,4 +37,9 @@ class ReplPrinter(_ctx: Context) extends DecompilerPrinter(_ctx) {
37
37
else " :" ~~ toText(sym.info)
38
38
}
39
39
}
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
40
45
}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ object SyntaxHighlighting {
31
31
private val tripleQs = Console .RED_B + " ???" + NoColor
32
32
33
33
private val keywords : Seq [String ] = for {
34
- index <- IF to ENUM // All alpha keywords
34
+ index <- IF to ERASED // All alpha keywords
35
35
} yield tokenString(index)
36
36
37
37
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