Skip to content

Commit 8a27d34

Browse files
committed
Fix #4301: Show null as "null"
1 parent b2476a4 commit 8a27d34

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compiler/test-resources/repl/i4301

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
scala> List(null)
2+
val res0: List[Null] = List(null)

library/src/dotty/Show.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trait Show[T] {
66

77
trait LowPrioShow {
88
implicit def defaultShow[T]: Show[T] = new Show[T] {
9-
def show(x: T) = x.toString
9+
def show(x: T) = String.valueOf(x)
1010
}
1111
}
1212

0 commit comments

Comments
 (0)