From 3a11ff78bf36a126edd90adb5d21b0280ab03533 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 1 Dec 2016 15:13:28 +0100 Subject: Use Nil.type and None.type instead of superclasses --- library/src/dotty/Show.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'library') diff --git a/library/src/dotty/Show.scala b/library/src/dotty/Show.scala index 5b75a6ea3..2feeb29ef 100644 --- a/library/src/dotty/Show.scala +++ b/library/src/dotty/Show.scala @@ -76,8 +76,8 @@ object Show { else "List(" + xs.map(_.show).mkString(", ") + ")" } - implicit val showNil: Show[List[Nothing]] = new Show[List[Nothing]] { - def show(xs: List[Nothing]) = "Nil" + implicit val showNil: Show[Nil.type] = new Show[Nil.type] { + def show(xs: Nil.type) = "Nil" } implicit def showOption[T](implicit st: Show[T]): Show[Option[T]] = new Show[Option[T]] { @@ -87,8 +87,8 @@ object Show { } } - implicit val showNone: Show[Option[Nothing]] = new Show[Option[Nothing]] { - def show(n: Option[Nothing]) = "None" + implicit val showNone: Show[None.type] = new Show[None.type] { + def show(n: None.type) = "None" } implicit def showMap[K,V](implicit sk: Show[K], sv: Show[V]): Show[Map[K,V]] = new Show[Map[K,V]] { -- cgit v1.2.3