From 63bf7f3349dd2f3844d5d53cae38a5fa625da4ce Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 20 Dec 2023 14:00:10 +0100 Subject: [PATCH] Properly identify empty bounds in error message This caused a trailing space which can easily misbehave in checkfiles. --- compiler/src/dotty/tools/dotc/reporting/Message.scala | 2 +- tests/neg/i13780-1.check | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/reporting/Message.scala b/compiler/src/dotty/tools/dotc/reporting/Message.scala index 484789a7fe45..22eac074a0fd 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Message.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Message.scala @@ -147,7 +147,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 _ => diff --git a/tests/neg/i13780-1.check b/tests/neg/i13780-1.check index 029ef3f3ac4b..07cc03b35dce 100644 --- a/tests/neg/i13780-1.check +++ b/tests/neg/i13780-1.check @@ -5,7 +5,7 @@ | Required: h | | where: VS is a type in method foo with bounds <: Tuple - | h is a type in method foo with bounds + | h is a type in method foo | t is a type in method foo with bounds <: Tuple | |