Skip to content

Commit 06ae047

Browse files
adriaanmgbasler
authored andcommitted
Debug printing for Any, not AnyRef, to include primitives
Signed-off-by: Gerard Basler <[email protected]>
1 parent b64a5ec commit 06ae047

File tree

1 file changed

+3
-3
lines changed
  • src/compiler/scala/tools/nsc/transform/patmat

1 file changed

+3
-3
lines changed

src/compiler/scala/tools/nsc/transform/patmat/Logic.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ trait Logic extends Debugging {
1717
import PatternMatchingStats._
1818

1919
private def max(xs: Seq[Int]) = if (xs isEmpty) 0 else xs max
20-
private def alignedColumns(cols: Seq[AnyRef]): Seq[String] = {
21-
def toString(x: AnyRef) = if (x eq null) "" else x.toString
20+
private def alignedColumns(cols: Seq[Any]): Seq[String] = {
21+
def toString(x: Any) = if (x == null) "" else x.toString
2222
if (cols.isEmpty || cols.tails.isEmpty) cols map toString
2323
else {
2424
val colLens = cols map (c => toString(c).length)
@@ -33,7 +33,7 @@ trait Logic extends Debugging {
3333
}
3434
}
3535

36-
def alignAcrossRows(xss: List[List[AnyRef]], sep: String, lineSep: String = "\n"): String = {
36+
def alignAcrossRows(xss: List[List[Any]], sep: String, lineSep: String = "\n"): String = {
3737
val maxLen = max(xss map (_.length))
3838
val padded = xss map (xs => xs ++ List.fill(maxLen - xs.length)(null))
3939
padded.transpose.map(alignedColumns).transpose map (_.mkString(sep)) mkString(lineSep)

0 commit comments

Comments
 (0)