Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly identify empty bounds in error message #19310

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/reporting/Message.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 _ =>
Expand Down
2 changes: 1 addition & 1 deletion tests/neg/i13780-1.check
Original file line number Diff line number Diff line change
Expand Up @@ -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
|
|
Expand Down
Loading