Skip to content

Commit 63bf7f3

Browse files
committed
Properly identify empty bounds in error message
This caused a trailing space which can easily misbehave in checkfiles.
1 parent 33bdaac commit 63bf7f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/reporting/Message.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ object Message:
147147
}
148148

149149
def addendum(cat: String, info: Type): String = info match {
150-
case bounds @ TypeBounds(lo, hi) if bounds ne TypeBounds.empty =>
150+
case bounds @ TypeBounds(lo, hi) if !(bounds =:= TypeBounds.empty) =>
151151
if (lo eq hi) i" which is an alias of $lo"
152152
else i" with $cat ${boundsStr(bounds)}"
153153
case _ =>

tests/neg/i13780-1.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| Required: h
66
|
77
| where: VS is a type in method foo with bounds <: Tuple
8-
| h is a type in method foo with bounds
8+
| h is a type in method foo
99
| t is a type in method foo with bounds <: Tuple
1010
|
1111
|

0 commit comments

Comments
 (0)