diff --git a/compiler/src/dotty/tools/dotc/printing/Formatting.scala b/compiler/src/dotty/tools/dotc/printing/Formatting.scala index b8271ba19f25..1ab2be541d6d 100644 --- a/compiler/src/dotty/tools/dotc/printing/Formatting.scala +++ b/compiler/src/dotty/tools/dotc/printing/Formatting.scala @@ -77,10 +77,6 @@ object Formatting { class SyntaxFormatter(sc: StringContext) extends StringFormatter(sc) { override protected def showArg(arg: Any)(implicit ctx: Context): String = arg match { - case arg: Showable if ctx.settings.color.value != "never" => - val highlighted = - SyntaxHighlighting(wrapNonSensical(arg, super.showArg(arg))) - new String(highlighted.toArray) case hl: Highlight => hl.show case hb: HighlightBuffer => diff --git a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala index b894b8dc312d..2fbe569daec2 100644 --- a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala @@ -729,7 +729,7 @@ object messages { val msg = hl"""|${NoColor(msgPrefix)} type arguments for $prettyName$expectedArgString |expected: $expectedArgString - |actual: $actualArgString""".stripMargin + |actual: ${NoColor(actualArgString)}""".stripMargin val explanation = { val tooManyTypeParams = @@ -1418,11 +1418,11 @@ object messages { val msg = hl"$tpe does not take type parameters" private val ps = - if (params.size == 1) hl"a type parameter ${params.head}" - else hl"type parameters ${params.map(_.show).mkString(", ")}" + if (params.size == 1) s"a type parameter ${params.head}" + else s"type parameters ${params.map(_.show).mkString(", ")}" val explanation = - i"""You specified $ps for ${hl"$tpe"}, which is not + i"""You specified ${NoColor(ps)} for ${hl"$tpe"}, which is not |declared to take any. |""" }