Skip to content

Commit d34b0dc

Browse files
committed
Move more logic from UserFacingPrinter to RefinedPrinter
1 parent c98288f commit d34b0dc

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
178178
if (tp.symbol.isAnonymousClass && !ctx.settings.uniqid.value)
179179
return toText(tp.info)
180180
case ExprType(result) =>
181-
return "=> " ~ toText(result)
181+
return (if (YprintRepl) ": " else "=> ") ~ toText(result)
182182
case ErasedValueType(tycon, underlying) =>
183183
return "ErasedValueType(" ~ toText(tycon) ~ ", " ~ toText(underlying) ~ ")"
184184
case tp: ClassInfo =>

compiler/src/dotty/tools/dotc/printing/UserFacingPrinter.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,4 @@ class UserFacingPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
1212
if (sym.name.isReplAssignName) nameString(sym.name)
1313
else keyString(sym) ~~ nameString(sym.name.stripModuleClassSuffix)
1414

15-
override def toText(tp: Type): Text = tp match {
16-
case ExprType(result) => ":" ~~ toText(result)
17-
case tp => super.toText(tp)
18-
}
1915
}

compiler/src/dotty/tools/dotc/util/DiffUtil.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ object DiffUtil {
111111
}.mkString
112112
}
113113

114-
private def added(str: String): String = bgColored(str, Console.GREEN)
115-
private def deleted(str: String) = bgColored(str, Console.RED)
114+
private def added(str: String): String = bgColored(str, Console.GREEN_B)
115+
private def deleted(str: String) = bgColored(str, Console.RED_B)
116116
private def bgColored(str: String, color: String): String = {
117117
if (str.isEmpty) ""
118118
else {

0 commit comments

Comments
 (0)