Skip to content

Commit 0336e68

Browse files
Properly identify empty bounds in error message (#19310)
This caused a trailing space which can easily misbehave in checkfiles.
2 parents d3fafd6 + 63bf7f3 commit 0336e68

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
@@ -146,7 +146,7 @@ object Message:
146146
}
147147

148148
def addendum(cat: String, info: Type): String = info match {
149-
case bounds @ TypeBounds(lo, hi) if bounds ne TypeBounds.empty =>
149+
case bounds @ TypeBounds(lo, hi) if !(bounds =:= TypeBounds.empty) =>
150150
if (lo eq hi) i" which is an alias of $lo"
151151
else i" with $cat ${boundsStr(bounds)}"
152152
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)