Skip to content

Commit

Permalink
Add color to show
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Jul 4, 2022
1 parent 9fb21c3 commit f51e1fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler/src/dotty/tools/dotc/transform/init/Semantic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ object Semantic:
*
*/
sealed abstract class Value:
def show: String = this match
def show(using Context): String = this match
case ThisRef(klass) =>
"ThisRef[" + klass.show + "]"
case Warm(klass, outer, ctor, args) =>
"Warm[" + klass + "] { outer = " + outer.show + ", args = " + args.map(_.show).mkString("(", ", ", ")") + " }"
"Warm[" + klass.show + "] { outer = " + outer.show + ", args = " + args.map(_.show).mkString("(", ", ", ")") + " }"
case Fun(expr, thisV, klass) =>
"Fun { this = " + thisV.show + ", owner = " + klass + " }"
"Fun { this = " + thisV.show + ", owner = " + klass.show + " }"
case RefSet(values) =>
values.map(_.show).mkString("Set { ", ", ", " }")
case _ =>
Expand Down

0 comments on commit f51e1fc

Please sign in to comment.