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].

[Cherry-picked 22ea677]
  • Loading branch information
dwijnand authored and WojciechMazur committed Dec 3, 2024
1 parent fdbae42 commit 6270225
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 @@ -74,6 +74,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 6270225

Please sign in to comment.