Skip to content

Commit b01a23f

Browse files
committed
Patch tree bounds printer
1 parent c2b5062 commit b01a23f

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

compiler/src/scala/quoted/runtime/impl/printers/SourceCode.scala

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,18 +1345,22 @@ object SourceCode {
13451345
}
13461346

13471347
private def printBoundsTree(bounds: TypeBoundsTree)(using elideThis: Option[Symbol]): this.type = {
1348-
bounds.low match {
1349-
case Inferred() =>
1350-
case low =>
1351-
this += " >: "
1352-
printTypeTree(low)
1353-
}
1354-
bounds.hi match {
1355-
case Inferred() => this
1356-
case hi =>
1357-
this += " <: "
1358-
printTypeTree(hi)
1359-
}
1348+
if bounds.low.tpe =:= bounds.hi.tpe then
1349+
this += " = "
1350+
printTypeTree(bounds.low)
1351+
else
1352+
bounds.low match {
1353+
case Inferred() =>
1354+
case low =>
1355+
this += " >: "
1356+
printTypeTree(low)
1357+
}
1358+
bounds.hi match {
1359+
case Inferred() => this
1360+
case hi =>
1361+
this += " <: "
1362+
printTypeTree(hi)
1363+
}
13601364
}
13611365

13621366
private def printBounds(bounds: TypeBounds)(using elideThis: Option[Symbol]): this.type = {

0 commit comments

Comments
 (0)