Skip to content

Commit 3a11ff7

Browse files
committed
Use Nil.type and None.type instead of superclasses
1 parent 454f09e commit 3a11ff7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/src/dotty/Show.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ object Show {
7676
else "List(" + xs.map(_.show).mkString(", ") + ")"
7777
}
7878

79-
implicit val showNil: Show[List[Nothing]] = new Show[List[Nothing]] {
80-
def show(xs: List[Nothing]) = "Nil"
79+
implicit val showNil: Show[Nil.type] = new Show[Nil.type] {
80+
def show(xs: Nil.type) = "Nil"
8181
}
8282

8383
implicit def showOption[T](implicit st: Show[T]): Show[Option[T]] = new Show[Option[T]] {
@@ -87,8 +87,8 @@ object Show {
8787
}
8888
}
8989

90-
implicit val showNone: Show[Option[Nothing]] = new Show[Option[Nothing]] {
91-
def show(n: Option[Nothing]) = "None"
90+
implicit val showNone: Show[None.type] = new Show[None.type] {
91+
def show(n: None.type) = "None"
9292
}
9393

9494
implicit def showMap[K,V](implicit sk: Show[K], sv: Show[V]): Show[Map[K,V]] = new Show[Map[K,V]] {

0 commit comments

Comments
 (0)