Skip to content

Commit

Permalink
Implement Show[Seq[Nothing]] (#21435)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand authored Sep 11, 2024
2 parents f95a131 + 22ea677 commit 4891858
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/printing/Formatting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ object Formatting {
given [X: Show]: Show[Seq[X]] with
def show(x: Seq[X]) = CtxShow(x.map(toStr))

given Show[Seq[Nothing]] with
def show(x: Seq[Nothing]) = CtxShow(x)

given [K: Show, V: Show]: Show[Map[K, V]] with
def show(x: Map[K, V]) =
CtxShow(x.map((k, v) => s"${toStr(k)} => ${toStr(v)}"))
Expand Down

0 comments on commit 4891858

Please sign in to comment.