From 43e0f2271b4329eff7f133862e483624d5a1861f Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Tue, 25 Jun 2024 14:17:32 +0200 Subject: [PATCH] Properly identify empty bounds in error message This caused a trailing space which can easily misbehave in checkfiles. [Cherry-picked 63bf7f3349dd2f3844d5d53cae38a5fa625da4ce][modified] --- compiler/src/dotty/tools/dotc/reporting/Message.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/reporting/Message.scala b/compiler/src/dotty/tools/dotc/reporting/Message.scala index 6fbfd5928d70..9581d28cdfcb 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Message.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Message.scala @@ -125,7 +125,7 @@ object Message: } def addendum(cat: String, info: Type): String = info match { - case bounds @ TypeBounds(lo, hi) if bounds ne TypeBounds.empty => + case bounds @ TypeBounds(lo, hi) if !(bounds =:= TypeBounds.empty) => if (lo eq hi) i" which is an alias of $lo" else i" with $cat ${boundsStr(bounds)}" case _ =>