Skip to content

Commit

Permalink
Implement Show[Seq[Nothing]]
Browse files Browse the repository at this point in the history
Somehow I hit this requirement, and it picked two other instances and
calling them ambiguous, because it was looking for a Show[Nothing].
  • Loading branch information
dwijnand committed Aug 25, 2024
1 parent 5101daf commit 22ea677
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 22ea677

Please sign in to comment.