diff options
Diffstat (limited to 'src/dotty/tools/dotc/typer/ErrorReporting.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/ErrorReporting.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/ErrorReporting.scala b/src/dotty/tools/dotc/typer/ErrorReporting.scala index 177882688..cda37f486 100644 --- a/src/dotty/tools/dotc/typer/ErrorReporting.scala +++ b/src/dotty/tools/dotc/typer/ErrorReporting.scala @@ -93,7 +93,7 @@ object ErrorReporting { def treatArg(arg: Any, suffix: String): (Any, String) = arg match { case arg: Showable => (arg.show, suffix) - case arg: List[_] if suffix.head == '%' => + case arg: List[_] if suffix.nonEmpty && suffix.head == '%' => val (sep, rest) = suffix.tail.span(_ != '%') if (rest.nonEmpty) (arg mkString sep, rest.tail) else (arg, suffix) |