From 0a4891153f65315473cac4294b0427a071efa70a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 8 Feb 2017 21:08:49 +1100 Subject: Fix mal-formatting. Insert an empty line before "where" in an explanation. --- compiler/src/dotty/tools/dotc/printing/Formatting.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/printing') diff --git a/compiler/src/dotty/tools/dotc/printing/Formatting.scala b/compiler/src/dotty/tools/dotc/printing/Formatting.scala index 05f1af9d7..760b22689 100644 --- a/compiler/src/dotty/tools/dotc/printing/Formatting.scala +++ b/compiler/src/dotty/tools/dotc/printing/Formatting.scala @@ -213,9 +213,11 @@ object Formatting { * ex"disambiguate $tpe1 and $tpe2" * ``` */ - def explained2(op: Context => String)(implicit ctx: Context): String = { + def explained(op: Context => String)(implicit ctx: Context): String = { val seen = new Seen - op(explainCtx(seen)) ++ explanations(seen) + val msg = op(explainCtx(seen)) + val addendum = explanations(seen) + if (addendum.isEmpty) msg else msg ++ "\n\n" ++ addendum } /** When getting a type mismatch it is useful to disambiguate placeholders like: -- cgit v1.2.3