diff options
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r-- | src/dotty/tools/dotc/typer/ErrorReporting.scala | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/ErrorReporting.scala b/src/dotty/tools/dotc/typer/ErrorReporting.scala index a078476e3..a23e87811 100644 --- a/src/dotty/tools/dotc/typer/ErrorReporting.scala +++ b/src/dotty/tools/dotc/typer/ErrorReporting.scala @@ -97,16 +97,20 @@ object ErrorReporting { } def treatArg(arg: Any, suffix: String): (Any, String) = arg match { - case arg: Showable => - (arg.show, suffix) case arg: List[_] if suffix.nonEmpty && suffix.head == '%' => - val (sep, rest) = suffix.tail.span(_ != '%') - if (rest.nonEmpty) (arg mkString sep, rest.tail) + val (rawsep, rest) = suffix.tail.span(_ != '%') + val sep = StringContext.treatEscapes(rawsep) + if (rest.nonEmpty) (arg map treatSingleArg mkString sep, rest.tail) else (arg, suffix) case _ => (arg, suffix) } + def treatSingleArg(arg: Any) : Any = arg match { + case arg: Showable => arg.show + case _ => arg + } + if (ctx.reporter.hasErrors && ctx.suppressNonSensicalErrors && !ctx.settings.YshowSuppressedErrors.value && |