@@ -289,18 +289,20 @@ trait Printers
289289 }
290290
291291 def visitConstant (x : Constant ): Buffer = x match {
292- case Constant .Unit () => this += " Constant.Unit()"
293- case Constant .Null () => this += " Constant.Null()"
294- case Constant .Boolean (value) => this += " Constant.Boolean(" += value += " )"
295- case Constant .Byte (value) => this += " Constant.Byte(" += value += " )"
296- case Constant .Short (value) => this += " Constant.Short(" += value += " )"
297- case Constant .Char (value) => this += " Constant.Char(" += value += " )"
298- case Constant .Int (value) => this += " Constant.Int(" += value.toString += " )"
299- case Constant .Long (value) => this += " Constant.Long(" += value += " )"
300- case Constant .Float (value) => this += " Constant.Float(" += value += " )"
301- case Constant .Double (value) => this += " Constant.Double(" += value += " )"
302- case Constant .String (value) => this += " Constant.String(\" " += value += " \" )"
303- case Constant .ClassTag (value) => this += " Constant.ClassTag(" += value += " )"
292+ case Constant (()) => this += " Constant(())"
293+ case Constant (null ) => this += " Constant(null)"
294+ case Constant (value : Boolean ) => this += " Constant(" += value += " )"
295+ case Constant (value : Byte ) => this += " Constant(" += value += " : Byte)"
296+ case Constant (value : Short ) => this += " Constant(" += value += " : Short)"
297+ case Constant (value : Char ) => this += " Constant('" += value += " ')"
298+ case Constant (value : Int ) => this += " Constant(" += value.toString += " )"
299+ case Constant (value : Long ) => this += " Constant(" += value += " L)"
300+ case Constant (value : Float ) => this += " Constant(" += value += " f)"
301+ case Constant (value : Double ) => this += " Constant(" += value += " d)"
302+ case Constant (value : String ) => this += " Constant(\" " += value += " \" )"
303+ case Constant .ClassTag (value) =>
304+ this += " Constant.ClassTag("
305+ visitType(value) += " )"
304306 }
305307
306308 def visitType (x : TypeOrBounds ): Buffer = x match {
@@ -728,7 +730,7 @@ trait Printers
728730
729731 case While (cond, body) =>
730732 (cond, body) match {
731- case (Block (Block (Nil , body1) :: Nil , Block (Nil , cond1)), Literal (Constant . Unit ( ))) =>
733+ case (Block (Block (Nil , body1) :: Nil , Block (Nil , cond1)), Literal (Constant (() ))) =>
732734 this += highlightKeyword(" do " )
733735 printTree(body1) += highlightKeyword(" while " )
734736 inParens(printTree(cond1))
@@ -990,7 +992,7 @@ trait Printers
990992 while (it.hasNext)
991993 extractFlatStats(it.next())
992994 extractFlatStats(expansion)
993- case Literal (Constant . Unit ( )) => // ignore
995+ case Literal (Constant (() )) => // ignore
994996 case stat => flatStats += stat
995997 }
996998 def extractFlatExpr (term : Term ): Term = term match {
@@ -1374,17 +1376,17 @@ trait Printers
13741376 }
13751377
13761378 def printConstant (const : Constant ): Buffer = const match {
1377- case Constant . Unit ( ) => this += highlightLiteral(" ()" )
1378- case Constant . Null ( ) => this += highlightLiteral(" null" )
1379- case Constant . Boolean (v ) => this += highlightLiteral(v.toString)
1380- case Constant . Byte (v ) => this += highlightLiteral(v.toString)
1381- case Constant . Short (v ) => this += highlightLiteral(v.toString)
1382- case Constant . Int (v ) => this += highlightLiteral(v.toString)
1383- case Constant . Long (v ) => this += highlightLiteral(v.toString + " L" )
1384- case Constant . Float (v ) => this += highlightLiteral(v.toString + " f" )
1385- case Constant . Double (v ) => this += highlightLiteral(v.toString)
1386- case Constant . Char (v ) => this += highlightString('\' ' + escapedChar(v) + '\' ' )
1387- case Constant . String (v ) => this += highlightString('"' + escapedString(v) + '"' )
1379+ case Constant (() ) => this += highlightLiteral(" ()" )
1380+ case Constant ( null ) => this += highlightLiteral(" null" )
1381+ case Constant ( v : Boolean ) => this += highlightLiteral(v.toString)
1382+ case Constant ( v : Byte ) => this += highlightLiteral(v.toString)
1383+ case Constant ( v : Short ) => this += highlightLiteral(v.toString)
1384+ case Constant ( v : Int ) => this += highlightLiteral(v.toString)
1385+ case Constant ( v : Long ) => this += highlightLiteral(v.toString + " L" )
1386+ case Constant ( v : Float ) => this += highlightLiteral(v.toString + " f" )
1387+ case Constant ( v : Double ) => this += highlightLiteral(v.toString)
1388+ case Constant ( v : Char ) => this += highlightString('\' ' + escapedChar(v) + '\' ' )
1389+ case Constant ( v : String ) => this += highlightString('"' + escapedString(v) + '"' )
13881390 case Constant .ClassTag (v) =>
13891391 this += " classOf"
13901392 inSquare(printType(v))
0 commit comments